From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3023 invoked by alias); 15 Jul 2004 18:49:27 -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 2999 invoked from network); 15 Jul 2004 18:49:26 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Jul 2004 18:49:26 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i6FInQe1016747 for ; Thu, 15 Jul 2004 14:49:26 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i6FInP011876; Thu, 15 Jul 2004 14:49:25 -0400 Received: from [172.16.50.19] (vpn50-19.rdu.redhat.com [172.16.50.19]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i6FInPoI028460; Thu, 15 Jul 2004 14:49:25 -0400 Subject: Re: dwarf2-frame.c question for maintainers From: "Martin M. Hunt" To: Andrew Cagney Cc: Mark Kettenis , gdb@sources.redhat.com In-Reply-To: <40F6CE82.5040106@gnu.org> References: <1089749730.3026.18.camel@dragon> <40F56CCA.5080106@gnu.org> <1089827266.3010.2.camel@dragon> <40F58971.7000304@gnu.org> <1089912741.3028.14.camel@dragon> <40F6C5C3.3040302@gnu.org> <1089915300.3028.19.camel@dragon> <40F6CE82.5040106@gnu.org> Content-Type: text/plain Organization: Red Hat Inc. Message-Id: <1089917359.3028.26.camel@dragon> Mime-Version: 1.0 Date: Thu, 15 Jul 2004 18:54:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2004-07/txt/msg00178.txt.bz2 On Thu, 2004-07-15 at 11:35, Andrew Cagney wrote: > >>> Consider o32. Both the ABI and ISA are 32-bits, but GDB's CORE_ADDR may > >>> be 64-bits. Even if it doesn't appear to make a difference, the MIPS > >>> needs to always sign extend addresses/registers - that's the dogma :-) > > > > > > Right. And so back to the original question. What is the best way to > > have read_reg detect if it should sign-extend? We agreed that passing a > > pointer to the CU was out, as was using a global. Do I need to add > > something to gdbarch? > > Hmm, the architecture vector already has POINTER_TO_ADDRESS and > register_type that can be used to extract [signed] pointers and > registers. Can either of those be used here? You mean something like if (current_gdbarch->pointer_to_address == unsigned_pointer_to_address) return extract_unsigned_integer (buf, register_size (current_gdbarch, regnum)); else return extract_signed_integer (buf, register_size (current_gdbarch, regnum)); -- Martin M. Hunt Red Hat Inc.