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: xjnfx@doityourself.com, linux-c-programming@vger.kernel.org
Subject: Re: getting ebp from another process ?
Date: 03 Oct 2002 19:05:19 +0100	[thread overview]
Message-ID: <1033668319.2139.10.camel@god.stev.org> (raw)
In-Reply-To: <20021001214222.GA1672@cam.ac.uk>

On Tue, 2002-10-01 at 22:42, sos22@cam.ac.uk 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.
> I'm not quite sure what you're trying to do anymore, but I've assumed
> in the below that you have a process running under the UML, let's say
> X, which corresponds to a process running under the host kernel, let's
> say Y, and you want to extract ebp from process X into a process
> running on the host kernel, Z say.  Now, the problem is that Z cannot
> attach to Y because the UML kernel process is already attached to it.

i am not to sure why i am even doing it anymore.
it was to get a  stack trace from uml when really bad things happen
with the tracing thread.
 
> However, you probably don't need to do that: Run a debugger under the
> UML, and then have it attach to X.  There's nothing attached to X, so
> that should succeed.  The debugger can then communicate with Z in any
> of the usual ways (uml_mconsole, inet domain sockets, ...), and send
> it the ebp of the target process.

by the time i need the info uml and it debugger has fallen over.
its normally caused by bad problems from the uml and the uml tracing
thread. The reson for the ebp from a process is so its much faster
toget a stack dump and i dont need todo it by hand.

> It's a little long winded, and it would only work if X is a userspace
> process under the UML and not one of the kernel threads, but it's the
> simplest that comes to mind.
> 
> Of course, if you're trying to track down a kernel bug, you can just
> gdb the kernel processes (almost) directly using the ptrace proxy - I
> think there are some fairly good instructions on the UML project page.
> (Note: I haven't tried this, so I might be completely wrong.)

yes its works pritty well for most kernel bugs but not in the layer
when uml is going its wired task switching and syscall doging stuff.

thanks
	James








  parent reply	other threads:[~2002-10-03 18:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
  -- 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=1033668319.2139.10.camel@god.stev.org \
    --to=james@stev.org \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=sos22@cam.ac.uk \
    --cc=xjnfx@doityourself.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;
as well as URLs for NNTP newsgroup(s).