This is the mail archive of the gdb@sources.redhat.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]

Just-In-Time debugging with GDB


Hello,

I am interested in doing "just-in-time" debugging with gdb.  The basic
idea is to launch the program normally (not under the debugger), but
if an error occurs (e.g. memory protection exception), the debugger
magically launches and attaches to the program at the point of error.
The program could also cause the debugger to launch using a call to
some special procedure. This is available on other platforms and I
have used it quite a bit.  Perhaps it is also available in gdb ... if
so,
I would really appreciate a pointer to some information on it.

I have been trying to engineer a crude version of this on my own,
and it kinda works.  However, I would like to disable it if I decide
to launch the program under gdb (I don't need 2 debug sessions
for the same program!).  I thought I could determine if gdb was
already active by checking the signal handler for SIGINT.  I
figured that gdb would have installed a signal handler for this, and
thus if gdb was already running, the handler for SIGINT would
not be SIG_DFL.  Unfortunately, this is apparently not so.  Is
there some technique I can use to determine if my program is
running under the control of gdb?

Many thanks in advance to anyone that can provide guidance on
these issues.

Mike Kistler




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