From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27342 invoked by alias); 22 Sep 2014 18:21:27 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 27332 invoked by uid 89); 22 Sep 2014 18:21:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout23.012.net.il Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Sep 2014 18:21:24 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NCB00E00EO1JK00@a-mtaout23.012.net.il> for gdb@sourceware.org; Mon, 22 Sep 2014 21:21:22 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NCB00E09EZLFG90@a-mtaout23.012.net.il>; Mon, 22 Sep 2014 21:21:21 +0300 (IDT) Date: Mon, 22 Sep 2014 18:21:00 -0000 From: Eli Zaretskii Subject: Re: Complex DWARF expressions In-reply-to: <20140922061654.GA15537@host2.jankratochvil.net> To: Jan Kratochvil Cc: yao@codesourcery.com, gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83a95ry0rp.fsf@gnu.org> References: <83sijkydk4.fsf@gnu.org> <87a95sxkjr.fsf@codesourcery.com> <20140922061654.GA15537@host2.jankratochvil.net> X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00071.txt.bz2 > Date: Mon, 22 Sep 2014 08:16:54 +0200 > From: Jan Kratochvil > Cc: Eli Zaretskii , gdb@sourceware.org > > But $edx at the caller would be usually callee-clobbered so one would not be > able to read the value. This is why the caller's call instruction is described > by: > > <8><1663ca>: Abbrev Number: 24 (DW_TAG_GNU_call_site) > <1663cb> DW_AT_low_pc : 0x814d44f > <1663cf> DW_AT_abstract_origin: <0x15e7bc> > <9><1663d8>: Abbrev Number: 3 (DW_TAG_GNU_call_site_parameter) > <1663d9> DW_AT_location : 1 byte block: 52 (DW_OP_reg2 (edx)) > <1663db> DW_AT_GNU_call_site_value: 1 byte block: 30 (DW_OP_lit0) > > So one finds matching DW_TAG_GNU_call_site and then one finds > DW_TAG_GNU_call_site_parameter with matching DW_AT_location there. > > These rules have to be applied recursively, as in many cases there is for > example: > > <6><1669c2>: Abbrev Number: 3 (DW_TAG_GNU_call_site_parameter) > <1669c3> DW_AT_location : 1 byte block: 51 (DW_OP_reg1 (ecx)) > <1669c5> DW_AT_GNU_call_site_value: 7 byte block: f3 1 51 a ff ff 1a (DW_OP_GNU_entry_value: (DW_OP_reg1 (ecx)); DW_OP_const2u: 65535; DW_OP_and) Why can't GDB apply all this, and show a value for a given PC? We don't really expect anyone but a few DWARF specialists to understand all that you said above (I, for example, didn't understand any of it), right?