From: Daniel Jacobowitz <drow@false.org>
To: "Hanson, Jonathan M" <jonathan.m.hanson@intel.com>
Cc: gdb@sources.redhat.com
Subject: Re: Accessing x86 general-purpose registers
Date: Tue, 19 Oct 2004 02:23:00 -0000 [thread overview]
Message-ID: <20041018210537.GA1582@nevyn.them.org> (raw)
In-Reply-To: <C863B68032DED14E8EBA9F71EB8FE4C20508B471@azsmsx406>
On Mon, Oct 18, 2004 at 01:03:42PM -0700, Hanson, Jonathan M wrote:
> My question really isn't about GDB per se but I was hoping some
> of the developers on this list would be able to help with what I'm
> trying to do.
> I have written a kernel module that, when triggered by an event,
> dumps out the contents of memory and the architectural state of the
> system to two files. The problem I'm running into is that the general
> purpose registers (EAX, EBX, EIP, etc.) I'm storing are incorrect. To
> investigate this problem I've downloaded the source to GDB and I've been
> looking at how GDB accomplishes this.
> In include/asm-i386/user.h is a structure called struct user
> with a member struct user_pt_regs, which is where GDB gets the general
> purpose register information for a program being debugged. I can see
> nowhere else in the kernel where this structure is written to. How is
> this information populated? Is there a way I can access this structure
> from the kernel itself?
I am inferring from context that you are talking about Linux. You may
have better luck on a Linux development list; GDB uses ptrace, and the
kernel takes care of connecting the registers to that.
--
Daniel Jacobowitz
next prev parent reply other threads:[~2004-10-18 21:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-18 23:41 Hanson, Jonathan M
2004-10-19 2:23 ` Daniel Jacobowitz [this message]
2004-10-19 13:28 ` Michael Chastain
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=20041018210537.GA1582@nevyn.them.org \
--to=drow@false.org \
--cc=gdb@sources.redhat.com \
--cc=jonathan.m.hanson@intel.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