From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 820 invoked by alias); 5 Jul 2002 03:05:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24413 invoked from network); 5 Jul 2002 02:58:34 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 5 Jul 2002 02:58:34 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id AE1835EA11; Thu, 4 Jul 2002 21:58:32 -0500 (EST) To: Mark Kettenis Cc: gdb@sources.redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFC] Implementation of DW_OP_deref and DW_OP_deref_size operators References: <200207042202.g64M2hT62589@elgar.kettenis.dyndns.org> From: Jim Blandy Date: Thu, 04 Jul 2002 20:23:00 -0000 In-Reply-To: <200207042202.g64M2hT62589@elgar.kettenis.dyndns.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-07/txt/msg00095.txt.bz2 Mark Kettenis writes: > After staring for a while at some compiler warnings resulting from an > attempt to make an i386 x x86-64 cross-debugger, and failing to > understand the code that implements the DW_OP_deref and > DW_OP_deref_size operators I think I've found out what's wrong. > > These expressions are supposed to dereference pointers. In GDB this > means that they should look at the address indicated by the pointer > they're dereferencing *in the target*. The current code is trying to > dereference a pointer in GDB. If we look at the history of this code > it is perfectly understandable. It is largely copied from the > unwinder that comes with GCC. This unwinder is supposed to be linked > into the program that contains the DWARF2 code, so in that context it > makes sense to lookup pointers in the program this code is running in. > > Does this sound reasonable? Yes! However, pointers are not always unsigned. I think on some 32-bit ABIs for 64-bit MIPS chips they need to be signed. Andrew will know the facts.