linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Stevenson <james@stev.org>
To: sos22@cam.ac.uk
Cc: linux-c-programming@vger.kernel.org
Subject: Re: getting ebp from another process ?
Date: 29 Sep 2002 18:39:33 +0100	[thread overview]
Message-ID: <1033321174.1676.28.camel@god.stev.org> (raw)
In-Reply-To: <20020929124614.GB415@cam.ac.uk>


> > under linux is it possible to get ebp from another
> > process without attaching a debugger to it ?
> Depends on what you mean by attaching a debugger.  If you just want
> avoid starting an external program like gdb, you can do it with
> ptrace:
> 
> struct user_regs_struct regs_struct;
> 
> ptrace(PTRACE_ATTACH, target_pid, NULL, NULL);
> waitpid(target_pid, NULL, WUNTRACED);
> ptrace(PTRACE_GETREGS, target_pid, NULL, &regs_struct);
> target_ebp = regs_struct.ebp;

yeah this is where the problem lies. because there is
already another process using ptrace on the process i want the info
from.

i will probably just end up modifiing the host kernel
so i can get the values from /proc/<pid>/ebp



  parent reply	other threads:[~2002-09-29 17:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-29 11:19 getting ebp from another process ? James Stevenson
     [not found] ` <20020929124614.GB415@cam.ac.uk>
2002-09-29 17:39   ` James Stevenson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-09-30 19:59 jnf
2002-09-30 20:38 ` James Stevenson
     [not found]   ` <20021001214222.GA1672@cam.ac.uk>
2002-10-03 18:05     ` James Stevenson

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=1033321174.1676.28.camel@god.stev.org \
    --to=james@stev.org \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=sos22@cam.ac.uk \
    /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;
as well as URLs for NNTP newsgroup(s).