From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23058 invoked by alias); 1 May 2019 23:02:17 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 23048 invoked by uid 89); 1 May 2019 23:02:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-7.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=15PM X-Spam-Status: No, score=-7.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 May 2019 23:02:16 +0000 Received: from librem.wildebeest.org (deer0x15.wildebeest.org [172.31.17.151]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 2C64530D8747; Thu, 2 May 2019 01:02:13 +0200 (CEST) Received: by librem.wildebeest.org (Postfix, from userid 1000) id B002EC0EC2; Thu, 2 May 2019 01:02:13 +0200 (CEST) Date: Wed, 01 May 2019 23:02:00 -0000 From: Mark Wielaard To: Sasha Da Rocha Pinheiro Cc: "elfutils-devel@sourceware.org" Subject: Re: Dwarf_Op Message-ID: <20190501230213.GD39969@wildebeest.org> References: <20190427175707.GI25602@wildebeest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2019-q2/txt/msg00057.txt.bz2 On Wed, May 01, 2019 at 05:08:15PM +0000, Sasha Da Rocha Pinheiro wrote: > yes, I did use dwarf_frame_register(), I believe I mentioned that :). Sorry, I missed that. > In the case I brought up you're saying it was an elfutils' libdw > decision to provide negative number as DW_OP_plus_uconst (unsigned > constant)? So there would be no harm to cast it to a signed int?? Yes, since I don't believe there is a better representation. There is no DW_OP_plus_sconst for example. > Do you know if the rules to find the registers will always have only > another one register associated to it? Because libdwarf function > dwarf_get_fde_info_for_reg3() returns a register_num, which is > described as: "Argument register_num should point to a location > which will hold the register number associated with the register > rule." I am not familiar with libdwarf, so don't know how to answer this question > elfutils only gives us a location description in an array of > Dwarf_Op. Does it provide methods to "execute" it so we can get the > result of the expressions? Or it delegates it to the consumer? It doesn't have a generic location description "executor". It really should have. But to make it generic it needs a lot of context. libdwfl does contain a partial operator interpreter for unwinding. See expr_eval in libdwfl/frame_unwind.c. To turn that into something more generic we would need some way to provide it with things like memory accessors and register values. libdwfl provides some of that through dwfl_attach_state. Cheers, Mark