This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: questions / suggestions about gdb
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Charles James Leonardo Quarra Cappiello <charsquarra at hotmail dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 07 May 2002 18:02:11 -0400
- Subject: Re: questions / suggestions about gdb
- References: <F16j4seHoEjAQUcV4od00005c81@hotmail.com>
> Daniel Jacobowitz wrote:
>
>
>> can i activate the 'generate-core-file' a few steps before the program
>> breaks?
>
> Whenever you want to; you just issue the command, and then you can come
> back to look at the core file later.
>
>
> my question is; how the debugger would automatically know that three steps further the program will break and generate a core file; i guess to generate core files on every (say, 100 steps) could help a lot too.
In theory .... In addition to saving the internal state of the program,
you'll need to record all the external state and any additional I/O that
the running program performs. That way you can exactly replay that
program's behavour (this gets tricky when you're trying to to timers
just right). I suspect you'd end up having to use a simulator for this.
Alternativly, you can ignore the external state problem and get
something working most of the time (via something like fork()?).
Another possability is to have GDB use its builtin-simulator to look
ahead a few instructions at what the inferior would do given its current
state. Provided the simulator doesn't modify the inferior (debugged
process) nor do I/O it shouldn't affect the program that is running.
enjoy,
Andrew