This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb 6.3 misses breakpoint on Linux when inferior does clone()
- From: <tronics93-gdb at yahoo dot com>
- To: gdb at sources dot redhat dot com
- Date: Tue, 31 May 2005 10:05:22 -0700 (PDT)
- Subject: Re: gdb 6.3 misses breakpoint on Linux when inferior does clone()
- Reply-to: tronics93-gdb at yahoo dot com
>> 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, ®s) < 0)
perror("ptrace_getregs failed:");
printf("syscall=%d, arg1=%#x, arg2=%#x\n", regs[ORIG_EAX],
regs[EBX], regs[ECX]);
--tronics93.