Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: tronics93-gdb@yahoo.com, gdb@sources.redhat.com
Subject: Re: gdb 6.3 misses breakpoint on Linux when inferior does clone()
Date: Sun, 12 Jun 2005 00:23:00 -0000	[thread overview]
Message-ID: <20050612002251.GA11866@nevyn.them.org> (raw)
In-Reply-To: <200506112331.j5BNVc4L020335@elgar.sibelius.xs4all.nl>

On Sun, Jun 12, 2005 at 01:31:38AM +0200, Mark Kettenis wrote:
>    Date: Wed, 1 Jun 2005 09:23:31 -0400
>    From: Daniel Jacobowitz <drow@false.org>
> 
>    On Tue, May 31, 2005 at 10:05:22AM -0700, tronics93-gdb@yahoo.com wrote:
>    > 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.
> 
> But having to do that in a machine-dependent manner really sucks...
> 
>    It could probably be implemented if someone spent the time.
> 
> ...so that time is probably better spent on implementing the proper
> machine-independent functionality in the Linux kernel!

Except that what we implement in GDB, we don't need to test for at
runtime and handle dependencies on the kernel version.  For the special
case of CLONE_VM there's a third option, which may be superior: write
to one thread's memory and see where the value shows up.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


  reply	other threads:[~2005-06-12  0:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-31 17:06 tronics93-gdb
2005-06-01 13:23 ` Daniel Jacobowitz
2005-06-11 23:31   ` Mark Kettenis
2005-06-12  0:23     ` Daniel Jacobowitz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-05-26 20:02 Satish Mohan
2005-05-26 20:03 ` Daniel Jacobowitz
2005-05-26 19:40 Satish Mohan
2005-05-26 19:43 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050612002251.GA11866@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=tronics93-gdb@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox