This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Complex DWARF expressions
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: yao at codesourcery dot com, gdb at sourceware dot org
- Date: Mon, 22 Sep 2014 20:44:12 +0200
- Subject: Re: Complex DWARF expressions
- Authentication-results: sourceware.org; auth=none
- References: <83sijkydk4 dot fsf at gnu dot org> <87a95sxkjr dot fsf at codesourcery dot com> <20140922061654 dot GA15537 at host2 dot jankratochvil dot net> <83a95ry0rp dot fsf at gnu dot org>
On Mon, 22 Sep 2014 20:21:14 +0200, Eli Zaretskii wrote:
> Why can't GDB apply all this, and show a value for a given PC?
There is some reason why GDB could not determine it, this is very normal
situation. It would be really great if GDB could always display all values
for -O2 -g code but that can never be possible (without reducing runtime code
peformance and size).
To find out why use: (gdb) set debug entry-values 1
For example the call site may not have matching DW_AT_GNU_call_site_value
because the value is just no longer computable at the caller frame from any
data at that point of execution. Entry values improved the number of cases
where the value is retrievable but it is still far from 100% retrievability.
One needs to use -O0 -g to get the values in 100% of cases. Debug info never
degrades inferior runtime code performance or size to get better debug info.
Besides that there may be GDB bug. And there is also at least one GCC bug:
entry-value: Missing DW_AT_linkage_name for C<->C++ calls
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56502
Jan