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]
Other format: [Raw text]

Re: Just-in-time debugging on Linux


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


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