Re:Reverse Execution in GDB 7 is imminent
by ars on Wednesday September 23, 2009 @01:20PM
(#839674)
Can this reverse through a seg fault?
[ Parent
| on HN ]
Re:Reverse Execution in GDB 7 is imminent
by ori_b on Wednesday September 23, 2009 @01:35PM
(#839703)
Why wouldn't it be able to? A segfault is just a signal like any other.
I thought it couldn't be caught, but I checked the docs, and it seems it can.
Hmm, maybe I should put that in all my programs - then I won't ever have bugs from segfaults.
:)
Re:Reverse Execution in GDB 7 is imminent
by bwd2 on Wednesday September 23, 2009 @03:36PM
(#839974)
Back in my student days long ago, a friend of mine who was working on a very difficult assignment hatched a plan to include a SIGSEGV handler that would print "NFS server not responding, still trying..." for use on the day when we had to demo the results to the TAs. The NFS system was pretty flaky and his hope was that the TA would move on to the next demo and get back to him, giving him time to fix whatever problem was happening. Not sure if he actually put it in though.
Re:Reverse Execution in GDB 7 is imminent
by huhtenberg on Wednesday September 23, 2009 @05:24PM
(#840150)
Back in my student days for DOS-based labs we just did
char foo[640*1024];
int main(int argc, char ** argv) { return 0; }
When ran, it made the OS say "Out of memory" and then it was lab assistant's headache to unload all that resident stuff that was sitting there and eating good 20-30% of available RAM. They typically opposed to doing that, so the TAs assumed the program actually worked. The end :)
Re:Reverse Execution in GDB 7 is imminent
by mahmud on Wednesday September 23, 2009 @09:23PM
(#840447)
I must be the only moron who used to be eager for others to see his programs. No teacher ever looked at it long enough to appreciate it though; I quickly established a reputation as a computer show off and the teachers were dismissive of me, spending more time with kid who actually had problems.
>> I quickly established a reputation as a computer show off
Hmm ... :)
Because the state of a process is undefined after a seg fault.
Re:Reverse Execution in GDB 7 is imminent
by cracki on Wednesday September 23, 2009 @02:20PM
(#839817)
"undefined" doesn't mean it has no state. it does have some state. it's just that this state can't be predicted. it can still be recorded and used in debugging backwards.
Re:Reverse Execution in GDB 7 is imminent
by ori_b on Wednesday September 23, 2009 @05:07PM
(#840129)
2 comments about that: First, it must be well defined in order for the operating system to be able to do something about the process. It may not be consistent, predictable to userspace, or runnable, but it must be something possibly sensible. Therefore, it doesn't matter, the debugger can still inspect it, and the programmer can make sense of this state.
Second, the debugger generally catches the signal before it gets handled.