This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How can if find out if program is running in a user-defined function ??



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]