public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Complex DWARF expressions
@ 2014-09-21 19:33 Eli Zaretskii
  2014-09-22  6:03 ` Yao Qi
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2014-09-21 19:33 UTC (permalink / raw)
  To: gdb

I was debugging a crash in an optimized program, and wanted to know
the value of some variable, but was greeted with "<optimized out>".
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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-22 19:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-21 19:33 Complex DWARF expressions Eli Zaretskii
2014-09-22  6:03 ` Yao Qi
2014-09-22  6:17   ` Jan Kratochvil
2014-09-22 18:21     ` Eli Zaretskii
2014-09-22 18:44       ` Jan Kratochvil
2014-09-22 19:06         ` Eli Zaretskii
2014-09-22 19:21           ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).