From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14008 invoked by alias); 9 May 2005 19:49:57 -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 13952 invoked from network); 9 May 2005 19:49:50 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 9 May 2005 19:49:50 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DVEGB-0007go-G0; Mon, 09 May 2005 15:49:47 -0400 Date: Mon, 09 May 2005 19:49:00 -0000 From: Daniel Jacobowitz To: "Bloch, Jack" Cc: gdb@sources.redhat.com Subject: Re: Reading target registers Message-ID: <20050509194947.GA29508@nevyn.them.org> Mail-Followup-To: "Bloch, Jack" , gdb@sources.redhat.com References: <2DA8F872430BE8469BF0F403A6103F9205CFC9@stca20aa.bocc.icn.siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2DA8F872430BE8469BF0F403A6103F9205CFC9@stca20aa.bocc.icn.siemens.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00120.txt.bz2 On Mon, May 09, 2005 at 12:44:05PM -0700, Bloch, Jack wrote: > While this is not a direct GDB question, I'm hoping someone can answer me. I > have an application which uses the ptrace interface to attach to a target > process and read the target registers (I'm specifically interested in the > EIP). It will run on a SuSE 2.6 Kernel x86 based machine. My code is below. You can only use PTRACE_GETREGS when the process is stopped; that may be the problem. After attaching be sure to wait(). Otherwise, try stracing to see what's going on. -- Daniel Jacobowitz CodeSourcery, LLC