From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 637 invoked by alias); 25 May 2010 20:17:25 -0000 Received: (qmail 625 invoked by uid 22791); 25 May 2010 20:17:22 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 May 2010 20:17:17 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4PKHAoX016641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 May 2010 16:17:10 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4PKHA39002146; Tue, 25 May 2010 16:17:10 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o4PKH8g6002012; Tue, 25 May 2010 16:17:09 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id A7BD43782C5; Tue, 25 May 2010 14:17:08 -0600 (MDT) From: Tom Tromey To: Jan Kratochvil Cc: Stan Shebs , gdb-patches@sourceware.org Subject: Re: RFC: DWARF expression disassembly References: <4BF327D2.3000802@codesourcery.com> <4BF6F1F8.9090301@earthlink.net> <20100525192457.GA22117@host0.dyn.jankratochvil.net> Reply-To: tromey@redhat.com Date: Tue, 25 May 2010 20:25:00 -0000 In-Reply-To: <20100525192457.GA22117@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Tue, 25 May 2010 21:24:57 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-05/txt/msg00578.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> On Tue, 25 May 2010 21:16:34 +0200, Tom Tromey wrote: >> This is not always possible, though, and in >> those cases it falls back to a disassembly form. Additionally, it adds >> a new parameter, "maint show dwarf2 always-disassemble", which can be >> set if you prefer to always get disassembly. Jan> I have to ask why have you duplicated Jan> binutils/dwarf.c:decode_location_expression(). I did think about this, and I have a few reasons. First, it really isn't that much code. (The code in gdb is actually much shorter, since we already have a table of opcode names.) Second, we want some specialized behavior: different piece handling, some output formatting details, and the fact that we want to only handle operations that gdb itself handles. (This latter may be a mistake; maybe we want to decode DW_OP_call* even though we can't evaluate them.) Jan> Asking primarily because I miss the register names decording in readelf. I don't see that in the code or the output. I see raw numbers like: (DW_OP_reg3; DW_OP_piece: 4; DW_OP_fbreg: 0; DW_OP_deref; DW_OP_plus_uconst: 6; DW_OP_stack_value; DW_OP_piece: 4) I can add decoding if you want. Maybe some other details need fixing too; if you agree with this general approach, feel free to list all the issues you run across and I will fix them up. Tom