[PATCH] Fix calling gcore when gdb is not in $PATH.

Luis Machado lgustavo@codesourcery.com
Mon Oct 14 12:24:00 GMT 2013


On 10/11/2013 04:00 PM, Jan Kratochvil wrote:
> On Fri, 11 Oct 2013 20:22:05 +0200, Luis Machado wrote:
>> Hmmm... unless there is some discrepancy between shell interpreters,
>> mine (bash) does the following:
>
> OK, true, it works thanks to the 'which' command there.
>
> But then why you have there the conditional
> 	if test "x$binary_path" = x. ; then
> ?
> You can run the 'which' block every time and it will work.

That's true. Though i've noticed that the following gives an unexpected 
result...

Invocation: sh gcore (with gcore living in ".")
The /usr/bin/gdb binary gets picked up, because "which gcore" returns 
nothing even if gcore lives in ".". *sigh*.

An additional check needs to be done. The attached update patch 
accomplishes this. It seems to cover all the scenarios.

I decided to add a chunk of code to error out in case the correct GDB 
binary is not found.

Thoughts?

Luis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcore.diff
Type: text/x-patch
Size: 2042 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20131014/01dbc644/attachment.bin>


More information about the Gdb-patches mailing list