From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27137 invoked by alias); 9 May 2005 21:02:37 -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 27074 invoked from network); 9 May 2005 21:02:29 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 9 May 2005 21:02:29 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DVFOW-0003sd-NH; Mon, 09 May 2005 17:02:28 -0400 Date: Mon, 09 May 2005 21:02:00 -0000 From: 'Daniel Jacobowitz' To: "Bloch, Jack" Cc: gdb@sources.redhat.com Subject: Re: Reading target registers Message-ID: <20050509210228.GA14517@nevyn.them.org> Mail-Followup-To: "Bloch, Jack" , gdb@sources.redhat.com References: <2DA8F872430BE8469BF0F403A6103F9205CFCC@stca20aa.bocc.icn.siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2DA8F872430BE8469BF0F403A6103F9205CFCC@stca20aa.bocc.icn.siemens.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00123.txt.bz2 On Mon, May 09, 2005 at 12:53:20PM -0700, Bloch, Jack wrote: > Thanks, I also waituntil the target is stopped before reading the > registers. I get a value, just not the correct value. I noticed that I get > the same incorrect value as the lsstack application which uses > ptrace(PTRACE_PEEKUSER,l_pid,EIP*4,0) > But GDB gets the correc value. I'm assuming it is something with my linking > or which version of user I'm including. I may be way off here but any help > is appreciated. A couple of things: - Always cast the arguments to ptrace. They are generally of type "long", which may not be the same as "int". - If you are debugging a 64-bit program you need a 64-bit GDB. Sounds like you're on a 32-bit system though. - Verify whether your headers are messed up. I already recommended the use of strace for this. It can decode the arguments. What is the incorrect value? What is the correct value? -- Daniel Jacobowitz CodeSourcery, LLC