Just because it is in your path in a terminal doesn't mean its in the path inherited by Geany. If started from menus it may not read the same shell startup files.
that's right, and I also tried this, I made a link to ensure gdb could be run from /usr/local/bin, and maybe, as what you said, there are some tricks about this "inherited" path used by Geany?