This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: How can if find out if program is running in a user-defined function ??
- To: Pierre Muller <muller at cerbere dot u-strasbg dot fr>
- Subject: Re: How can if find out if program is running in a user-defined function ??
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Tue, 18 Apr 2000 17:32:23 +0100
- Cc: Gdb List <gdb at sourceware dot cygnus dot com>
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
muller@cerbere.u-strasbg.fr said:
> I wanted to write a simple gdb init file that would set breakpoints
> at position I would like to analyse but who would also just run the
> program and directly exit if nothing special happens.
$_exitcode is set to the result of calling exit(); you could try hanging
something off that...
You could try
set $_exitcode = -1
run list of args
if ($_exitcode != -1)
...program called exit.
else
... hit something interesting.
end