ChrisZim / edb-debugger

Automatically exported from code.google.com/p/edb-debugger
GNU General Public License v2.0
0 stars 0 forks source link

FR: keep debugged application loaded after finished run #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago

Original comment by evan.teran on 4 Apr 2014 at 3:47