Re: Debugging an exec'ed process
- From: Paul Pluzhnikov <ppluzhnikov-nsp@xxxxxxxxx>
- Date: Sat, 05 Jul 2008 19:08:07 -0700
jt@xxxxxxxxxxx (Jens Thoms Toerring) writes:
Linny <linvin333@xxxxxxxxx> wrote:
We would like to use 'gdb' to debug our executable(with debugging
symbols) but the client which runs our module is a debug stripped
version.
It doesn't matter: you'd have the exact same problem if it was
built with full debug info.
Here is an answer:
(gdb) help set follow-fork-mode
Set debugger response to a program call of fork or vfork.
A fork or vfork creates a new process. follow-fork-mode can be:
parent - the original process is debugged after a fork
child - the new process is debugged after a fork
The unfollowed process will continue to run.
By default, the debugger will follow the parent process.
if ( ( cd = getenv( "CHILD_DEBUG" ) ) != NULL && *cd != '\0' )
{
fprintf( stderr, "Child process pid = %d\n", getpid( ) );
sleep( 36000 );
}
This technique often allows one to debug "early startup problems",
but likely isn't necessary for the OP's problem.
A useful variation is to check "DEBUGGER" environment variable,
and if set invoke DEBUGGER with correct executable and pid:
no need to sleep(), nor to retype pid.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.
- Prev by Date: Re: iovecs don't print right
- Next by Date: Re: dlopen dumps
- Previous by thread: Traceroute using IP option
- Next by thread: Wait_event_timeout kernel macro doubt
- Index(es):
Relevant Pages
|