From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27963 invoked by alias); 28 Apr 2007 22:40:47 -0000 Received: (qmail 27955 invoked by uid 22791); 28 Apr 2007 22:40:47 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.29.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 28 Apr 2007 23:40:45 +0100 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.8/8.13.8) with ESMTP id l3SMegKm101330 for ; Sat, 28 Apr 2007 22:40:42 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l3SMegHe3801108 for ; Sun, 29 Apr 2007 00:40:42 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l3SMefO5024386 for ; Sun, 29 Apr 2007 00:40:41 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l3SMefEh024381; Sun, 29 Apr 2007 00:40:41 +0200 Message-Id: <200704282240.l3SMefEh024381@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sun, 29 Apr 2007 00:40:41 +0200 Subject: Re: [rfc] dwarf2 unwinder and MIPS n32 To: drow@false.org (Daniel Jacobowitz) Date: Sat, 28 Apr 2007 22:52:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20070428202914.GA8077@caradoc.them.org> from "Daniel Jacobowitz" at Apr 28, 2007 04:29:14 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00385.txt.bz2 Daniel Jacobowitz wrote: > So what do we do about it? The patch below works for MIPS, but I'm > reasonably sure it's wrong; it avoids the architecture's > ADDRESS_TO_POINTER method entirely. If we pass the register's type to > store_typed_address we'll get various failures if the architecture > doesn't define the relevant register as a pointer. And MIPS doesn't, > partly because the register is 64-bit and the pointer would only be > 32-bit. Well, when we *read* a register in order to get (or compute) the CFA, read_reg does unpack_long (register_type (gdbarch, regnum), buf) which in turn uses either extract_type_address, extract_signed_integer, or extract_unsigned_integer, depending on the type. It may make sense to perform the analogous operation when *writing* the CFA to (an unwound copy of the contents of) a register. There is no "pack_long", but something like memcpy (buf, value_contents (value_from_longest (register_type (gdbarch, regnum), cfa)), register_size (gdbarch, regnum)); should have that effect. Not sure if that is the right thing to do in all cases, but at least it would be consistent ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com