This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: attach to a PID using a different exec


Daniel Jacobowitz <drow@false.org> writes:

> On Thu, Nov 13, 2008 at 12:18:20PM -0700, Tom Tromey wrote:
>> Sometimes I will start gdb like "gdb /some/path/to/gdb" and then
>> "attach PID" -- where PID is actually running "/some/other/gdb".
>> That is, the current exec file and the attached process disagree.
>> 
>> Right now this usually yields an error along the lines of:
>> "Cannot access memory at address 0x2e".
>> 
>> This patch changes gdb to look at the target's notion of the exec
>> file, and then switch to it if it differs from the current exec.
>
> This seems like a bad idea to me.  The canonical example is:
>
> /usr/bin/prog.stripped &
> gdb /home/drow/prog.debug $(pidof prog.stripped)
>
> I don't want GDB to prompt my to switch to the stripped program...

I think a warning would still be helpful, similar to what you get when
you load a core that does not match.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]