Just-in-time debugging on Linux

phi phi@hpfrcu81.france.hp.com
Sun Jun 9 02:36:00 GMT 2002


Robin Rowe wrote:
> 
> Michael,
> 
> >    signal(SIGSEGV, crash_handler);  /* This is the most common crash */
> 
> This is an interesting approach, but I want to trap unmodified programs.
> 


Then wrap them up in a script 

rename prog xyz into xyz.ori  this doesn't modify the prog?

then implement the script xyz that does

xyz::
#! your shell
gdb xyz.ori $@

and have you gdbinit (or other ways) to catch the signal you want.

At xyz invocation we start gdb wich start xyz.ori wich will catch the signal
and let you see.


==================

If you really don't want to rename xyz.ori then have the script xyz earlier in
your PATH and make the script invoke the xyz from its original path

Phi



More information about the Gdb mailing list