From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18350 invoked by alias); 16 Jul 2004 20:08:19 -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 18334 invoked from network); 16 Jul 2004 20:08:18 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 16 Jul 2004 20:08:18 -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 i6GK8Ie1021864 for ; Fri, 16 Jul 2004 16:08:18 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i6GK8Ga11347; Fri, 16 Jul 2004 16:08:16 -0400 To: "Martin M. Hunt" Cc: Andrew Cagney , Mark Kettenis , gdb@sources.redhat.com Subject: Re: dwarf2-frame.c question for maintainers 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> <1089917359.3028.26.camel@dragon> From: Jim Blandy Date: Fri, 16 Jul 2004 21:16:00 -0000 In-Reply-To: <1089917359.3028.26.camel@dragon> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-07/txt/msg00216.txt.bz2 Here is a terse way to extract the least-significant end of the register's value, regardless of endianness. *** dwarf2-frame.c.~1.36.~ 2004-06-17 16:42:41.000000000 -0500 --- dwarf2-frame.c 2004-07-16 14:57:09.000000000 -0500 *************** read_reg (void *baton, int reg) *** 214,219 **** --- 214,222 ---- buf = (char *) alloca (register_size (gdbarch, regnum)); frame_unwind_register (next_frame, regnum, buf); + store_unsigned_integer + (buf, TYPE_LENGTH (builtin_type_void_data_ptr), + extract_unsigned_integer (buf, register_size (gdbarch, regnum))); return extract_typed_address (buf, builtin_type_void_data_ptr); } Shouldn't that work? (Setting aside questions of whether it's pleasing to extract, store, and then re-extract the value.)