* Re: getting ebp from another process ?
@ 2002-09-30 19:59 jnf
2002-09-30 20:38 ` James Stevenson
0 siblings, 1 reply; 5+ messages in thread
From: jnf @ 2002-09-30 19:59 UTC (permalink / raw)
To: James Stevenson, sos22; +Cc: linux-c-programming
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, ®s_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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: getting ebp from another process ?
2002-09-30 19:59 getting ebp from another process ? jnf
@ 2002-09-30 20:38 ` James Stevenson
[not found] ` <20021001214222.GA1672@cam.ac.uk>
0 siblings, 1 reply; 5+ messages in thread
From: James Stevenson @ 2002-09-30 20:38 UTC (permalink / raw)
To: xjnfx; +Cc: sos22, linux-c-programming
On Mon, 2002-09-30 at 20:59, jnf wrote:
> 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?
its a little more complicated than that.
i am actually debugging kernel things in
http://user-mode-linux.sf.net/
which has a confusing method of working with
debuggers and does not keep a good copy of ebp around
but the process is already attached by a so called
debugger but really a system call interceptor.
its does not matter anymore i dont seem to need it now.
if i do in the future i will add a kernel patch to give it out in
/proc/<pid>/ebp or something.
James
^ permalink raw reply [flat|nested] 5+ messages in thread
* getting ebp from another process ?
@ 2002-09-29 11:19 James Stevenson
[not found] ` <20020929124614.GB415@cam.ac.uk>
0 siblings, 1 reply; 5+ messages in thread
From: James Stevenson @ 2002-09-29 11:19 UTC (permalink / raw)
To: linux-c-programming
Hi
under linux is it possible to get ebp from another
process without attaching a debugger to it ?
thanks
James
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-10-03 18:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-30 19:59 getting ebp from another process ? jnf
2002-09-30 20:38 ` 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
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).