From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31184 invoked by alias); 18 Oct 2004 20:03:45 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31166 invoked from network); 18 Oct 2004 20:03:43 -0000 Received: from unknown (HELO petasus.ch.intel.com) (143.182.124.5) by sourceware.org with SMTP; 18 Oct 2004 20:03:43 -0000 Received: from azsmsxvs040.ch.intel.com (azsmsxvs040.ch.intel.com [143.182.252.54]) by petasus.ch.intel.com (8.12.9-20030918-01/8.12.9/d: small-solo.mc,v 1.9 2004/01/09 01:01:53 root Exp $) with SMTP id i9IK4Qf4006543 for ; Mon, 18 Oct 2004 20:04:36 GMT Received: from azsmsx331-2.ch.intel.com ([10.2.161.41]) by azsmsxvs040.ch.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004101813034230470 for ; Mon, 18 Oct 2004 13:03:42 -0700 Received: from azsmsx406.amr.corp.intel.com ([10.2.161.31]) by azsmsx331-2.ch.intel.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 18 Oct 2004 13:03:42 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Accessing x86 general-purpose registers Date: Mon, 18 Oct 2004 23:41:00 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Hanson, Jonathan M" To: X-OriginalArrivalTime: 18 Oct 2004 20:03:42.0859 (UTC) FILETIME=[9154F5B0:01C4B54D] X-SW-Source: 2004-10/txt/msg00347.txt.bz2 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?