This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Fully automating GDB (aka how to make canned command strings see the exit status)
- From: "Ramana Radhakrishnan" <ramana dot radhakrishnan at codito dot com>
- To: alexjb at transitive dot com
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 16 Mar 2006 22:55:48 +0530 (IST)
- Subject: Re: Fully automating GDB (aka how to make canned command strings see the exit status)
- References: <1142529081.5372.14.camel@okra.transitives.com>
- Reply-to: ramana dot radhakrishnan at codito dot com
Hi,
Look at gdb scripts anyways. You could associate commands with
breakpoints. Quit on hitting a breakpoint on exit ?
break exit
commands
quit
Simple :
Have an external script that loops on this. In case the program hits a
SEGV gdb will get it and you have the context , else gdb exits.
Look at the while construct in gdb , maybe you can use that in case you
can't associate commands for breakpoints from scripts.
HTH
cheers
Ramana
> Hi,
>
> I've got a program I'm trying to debug that crashes on a very
> intermittent basis. I suspect the core dumps I'm getting are incomplete
> so I would like to try and catch the the crash live in gdb.
>
> I figure a canned script to run the program is the answer. However how
> do I tell if the program has exited successfully (in which case I can
> run again) to hitting the SEG and staying put for when I come back in
> the morning?
>
>
> --
> Alex, homepage: http://www.bennee.com/~alex/
> TV is chewing gum for the eyes. -- Frank Lloyd Wright
>
----
Ramana Radhakrishnan
GNU Tools
Codito Technologies