public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/29836] New: [gdb/symtab] Use current pc and location lists to evaluate DW_OP_entry_value for current frame
@ 2022-11-29 13:01 vries at gcc dot gnu.org
2022-11-29 21:47 ` [Bug symtab/29836] " cvs-commit at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2022-11-29 13:01 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29836
Bug ID: 29836
Summary: [gdb/symtab] Use current pc and location lists to
evaluate DW_OP_entry_value for current frame
Product: gdb
Version: unknown
Status: NEW
Severity: enhancement
Priority: P2
Component: symtab
Assignee: unassigned at sourceware dot org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
[ Spinoff PR of PR29813. ]
In some cases we can't evaluate a DW_OP_entry_value the usual way, by looking
at call site information.
We could try to use the .debug_loc information for the formal parameters of the
current function.
For instance, for a function f1, with parameter i, we find have location list
entries:
...
0037 1000067c 10000680 (DW_OP_reg3 (r3))
004a 10000680 10000690 (DW_OP_GNU_entry_value: (DW_OP_reg3 (r3));
DW_OP_stack_value)
...
and we could use the fact that the current pc is in the 1000067c-10000680
range, and that the range starts at the start of the function to deduce that
DW_OP_GNU_entry_value: (DW_OP_reg3 (r3)) == DW_OP_reg3 (r3).
Note that this only works for the current frame.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug symtab/29836] [gdb/symtab] Use current pc and location lists to evaluate DW_OP_entry_value for current frame
2022-11-29 13:01 [Bug symtab/29836] New: [gdb/symtab] Use current pc and location lists to evaluate DW_OP_entry_value for current frame vries at gcc dot gnu.org
@ 2022-11-29 21:47 ` cvs-commit at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-29 21:47 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=29836
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f3e033f32a0db3e81266a62b05f867b932a5995b
commit f3e033f32a0db3e81266a62b05f867b932a5995b
Author: Tom de Vries <tdevries@suse.de>
Date: Tue Nov 29 22:47:31 2022 +0100
[gdb/testsuite] Fix gdb.base/vla-optimized-out.exp for ppc64le
On powerpc64le-linux, I run into:
...
(gdb) PASS: gdb.base/vla-optimized-out.exp: o1: printed optimized out vla
p sizeof (a)^M
$2 = <optimized out>^M
(gdb) FAIL: gdb.base/vla-optimized-out.exp: o1: \
printed size of optimized out vla
...
The problem happens as follows.
In order to find the size of the optimized out vla, gdb needs to evaluate:
...
<155> DW_AT_upper_bound : 13 byte block: f3 1 53 23 1 8 20 24 8 20 26 31 1c
\
(DW_OP_GNU_entry_value: (DW_OP_reg3 (r3)); DW_OP_plus_uconst: 1;
DW_OP_const1u: 32; DW_OP_shl; DW_OP_const1u: 32; DW_OP_shra; DW_OP_lit1;
DW_OP_minus)
...
When trying to evaluate DW_OP_GNU_entry_value, it looks for a call site
matching the pc, but doesn't find it:
...
$ gdb -q -batch outputs/gdb.base/vla-optimized-out/vla-optimized-out-o1 \
-ex "break f1" -ex run -ex "set debug entry-values 1" -ex "print sizeof
(a)"
Breakpoint 1 at 0x1000067c: file vla-optimized-out.c, line 34.
Breakpoint 1, f1 (i=5) at vla-optimized-out.c:34
34 }
DW_OP_entry_value resolving cannot find DW_TAG_call_site 0x100006b0 in main
$1 = <optimized out>
....
The call site lookup fails because the call site label .LVL4:
...
bl f1 # 11 *call_value_nonlocal_aixdi [length = 8]
nop
.LVL4:
...
is not placed directly after the bl insn. This is gcc PR target/107909.
However, after manually fixing the .s file we have instead:
...
Cannot find matching parameter at DW_TAG_call_site 0x10000690 at main
$1 = <optimized out>
...
due to the fact that the call site has no call site parameters.
The call site does have a reference to the corresponding function f1, with
parameter i, for which we find location list entries:
...
0037 1000067c 10000680 (DW_OP_reg3 (r3))
004a 10000680 10000690 (DW_OP_GNU_entry_value: (DW_OP_reg3 (r3));
DW_OP_stack_value)
...
and we could use the fact that the current pc is in the 1000067c-10000680
range, and that that the range starts at the start of the function, to
deduce
that DW_OP_GNU_entry_value: (DW_OP_reg3 (r3)) == DW_OP_reg3 (r3).
But that's a non-trivial enhancement, filed as enhancement PR symtab/29836.
Fix this by allowing <optimized out> for target powerpc and the gcc
compiler.
Reviewed-By: Carl Love <cel@us.ibm.com>
Tested-By: Carl Love <cel@us.ibm.com>
PR testsuite/29813
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29813
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-29 21:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-29 13:01 [Bug symtab/29836] New: [gdb/symtab] Use current pc and location lists to evaluate DW_OP_entry_value for current frame vries at gcc dot gnu.org
2022-11-29 21:47 ` [Bug symtab/29836] " cvs-commit at gcc dot gnu.org
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).