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


Tom Tromey wrote:
"Daniel" == Daniel Jacobowitz <drow@false.org> writes:
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.

Daniel> This seems like a bad idea to me. The canonical example is: Daniel> /usr/bin/prog.stripped & Daniel> gdb /home/drow/prog.debug $(pidof prog.stripped) Daniel> I don't want GDB to prompt my to switch to the stripped program...

Well, you can answer "no". So while it is inconvenient, it seems
minor. On the other hand, the current situation can leave one with a
nonsensical setup. This bites me a lot more than I should probably
admit.
For multi-exec GDB, I added a set-exec command for just this situation - if you have multiple execs in the session, it's extremely difficult to tell which (if any) corresponds to the attached process. In practice so far, it's better than nothing, but we need more. We should have as many heuristics as possible, and ask for a confirmation too. (I wonder if comparing a handful of bytes, or sections, from each exec would be a useful check...)

Stan


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