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: gdb 6.3 misses breakpoint on Linux when inferior does clone()


On Tue, May 31, 2005 at 10:05:22AM -0700, tronics93-gdb@yahoo.com wrote:
> >> The kernel does not provide any interface for GDB to know whether
> or
> >> not a clone syscall has used CLONE_VM.   
> >> 
> >> [Satish] Doesn't ptrace(PTRACE_GETREGS,...) provide that
> information >>? Or is that arch. specific ?
> 
> >No, it does not.
> 
> The following code snippet gets the flags passed in to clone() (on
> x86):
> 
>    unsigned long regs[FRAME_SIZE];
> 
>    if (ptrace(PTRACE_GETREGS, pid, 0, &regs) < 0)
>         perror("ptrace_getregs failed:");
> 
>    printf("syscall=%d, arg1=%#x, arg2=%#x\n", regs[ORIG_EAX], 
>                               regs[EBX], regs[ECX]);

Only if you're stopped at the clone.  Hmm.  Good point; perhaps we can
recover them from registers when we receive the clone event.

It could probably be implemented if someone spent the time.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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