edb-debugger
edb-debugger copied to clipboard
FR: keep debugged application loaded after finished run
I don't know if this is the intended behavior, but after finishing a succesfull
run (eg. just F9 then S-F9), and clicking 'OK' in the popup ("Debugged
application exited..."), EDB unloads the application. This also happens when
you had breakpoints set, so you have to re-open the app and re-set the
breakpoints. It would be nice if EDB just reset the app and kept things like
breakpoints intact.
PS This is on EDB v0.9.2, but Bugzilla version field only goes up to v0.9.0
Original issue reported on code.google.com by evan.teran
on 3 Oct 2012 at 3:21
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The "problem" here is that the exit event gets sent to the debugger when the
application has actually exited. This means that it literally no longer exists.
I do believe that there is a ptrace flag to be able to trap exit events, so
I'll look into that and if possible, at least make it an option.
Evan Teran
Original comment by evan.teran
on 3 Oct 2012 at 3:56
- Added labels: ****
- Removed labels: ****
Well, I know that gdb can do this (ie. after exit of debuggee, allow you to
restart it with BPs intact) so it must be possible. A quick grep through the
kernel src revealed the option PTRACE_O_TRACEEXIT, which may be what you want.
Google turned up http://www.technovelty.org/linux/ptrace-exit.html, which talks
about this very thing. I'm guessing if you can save EDB's internal state (eg
BPs) at debuggee exit, and then reload debuggee and state after exit, you could
accomplish the desired behavior.
With gdb, the debuggee is also 'really terminated' at exit, ie disappears from
the process list, and then comes back after you restart, so it would seem gdb
does something similar to the above.
Original comment by evan.teran
on 3 Oct 2012 at 3:56
- Added labels: ****
- Removed labels: ****
yup, that's the flag I was thinking of. I'll look into it. I'm not quite sure
how the "resurrecting" works in GDB. Maybe I'll take a look at that code.
Currently to restart, I just kill the processes and run it again. Which
unfortunately has the side effect of re-doing the address space layout
randomization (making restoring breakpoint slightly more complicated, I plan to
address this with relative BPs stored in the session files).
Like I said, I'll look into it and try to make it an option.
Evan Teran
Original comment by evan.teran
on 3 Oct 2012 at 3:57
- Changed state: Accepted
- Added labels: ****
- Removed labels: ****