From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28212 invoked by alias); 21 Sep 2014 19:33:01 -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 28198 invoked by uid 89); 21 Sep 2014 19:32:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_RP_RNBL,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout27.012.net.il Received: from mtaout27.012.net.il (HELO mtaout27.012.net.il) (80.179.55.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 21 Sep 2014 19:32:57 +0000 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NC900G00N1GEN00@mtaout27.012.net.il> for gdb@sourceware.org; Sun, 21 Sep 2014 22:27:20 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC9008H5NDKGX80@mtaout27.012.net.il> for gdb@sourceware.org; Sun, 21 Sep 2014 22:27:20 +0300 (IDT) Date: Sun, 21 Sep 2014 19:33:00 -0000 From: Eli Zaretskii Subject: Complex DWARF expressions To: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83sijkydk4.fsf@gnu.org> X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00068.txt.bz2 I was debugging a crash in an optimized program, and wanted to know the value of some variable, but was greeted with "". So I tried to see if the value is in a register, and this is what I saw: (gdb) info address new_width Symbol "new_width" is multi-location: Range 0x100a847-0x100a8d9: a variable in $edx Range 0x100a8d9-0x100a8e6: a complex DWARF expression: 0: DW_OP_breg3 176 [$ebx] Range 0x100a8e6-0x100a8ee: a complex DWARF expression: 0: DW_OP_GNU_entry_value 2: DW_OP_reg2 [$edx] 3: DW_OP_stack_value Range 0x100a8ee-0x100a955: a variable in $edx Range 0x100a955-0x100aaed: a complex DWARF expression: 0: DW_OP_GNU_entry_value 2: DW_OP_reg2 [$edx] 3: DW_OP_stack_value Range 0x100aaed-0x100aaf7: a variable in $edx Range 0x100aaf7-0x100ad4c: a complex DWARF expression: 0: DW_OP_GNU_entry_value 2: DW_OP_reg2 [$edx] 3: DW_OP_stack_value "A variable in $edx" I understand, but what about the "complex DWARF expression" parts? Is there any way a mere mortal such as myself can decipher this to the effect of understanding in which register or at what address can I look up the value, assuming that I know at which PC address the program stopped? (Yes, I've looked at the DWARF Standard, but couldn't understand from the description of these location descriptors how to convert them to either a register or a memory address.) TIA for any help.