[PATCH] Make only user-specified executable filenames sticky

Doug Evans dje@google.com
Mon May 11 20:25:00 GMT 2015


On Wed, May 6, 2015 at 7:46 AM, Philippe Waroquiers
<philippe.waroquiers@skynet.be> wrote:
> On Wed, 2015-05-06 at 11:26 +0100, Gary Benson wrote:
>> Hi all,
>>
>> In GDB some executable files are supplied by the user (e.g. using a
>> "file" command) and some are determined by GDB (e.g. while processing
>> an "attach" command).  GDB will not attempt to determine a filename if
>> one has been set.  This causes problems if you attach to one process
>> and then attach to another: GDB will not attempt to discover the main
>> executable on the second attach.  If the two processes have different
>> main executable files then the symbols will now be wrong.
>>
>> This commit updates GDB to keep track of which executable filenames
>> were supplied by the user.  When GDB might attempt to determine an
>> executable filename and one is already set, filenames determined by
>> GDB may be overridden but user-supplied filenames will not.
> If not overriding the file set by the user, maybe GDB could/should give
> a warning when the exec-file reported by the target does not match the
> file as set by the user ?

Heh.  +1

[I don't have a strong opinion on how to perform the file matching test,
just that some notification should be given, especially if the files
in fact don't match.]



More information about the Gdb-patches mailing list