linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jnf <xjnfx@doityourself.com>
To: James Stevenson <james@stev.org>, sos22@cam.ac.uk
Cc: linux-c-programming@vger.kernel.org
Subject: Re: getting ebp from another process ?
Date: Mon, 30 Sep 2002 12:59:38 -0700 (PDT)	[thread overview]
Message-ID: <20020930195953.DB7C54001@sitemail.everyone.net> (raw)

im a little confused by what you mean from another process, meaning like - im not sure if you want it from a third process, or just mean another process from the debuggers point of view, but wouldnt
unsigned long foo(void) { __asm__("movl %ebp, %eax"); }
work?

>
>> > 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
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

_____________________________________________________________
Sign up for FREE email from DoItYourself.com at http://doityourself.com

_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag

             reply	other threads:[~2002-09-30 19:59 UTC|newest]

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