diff options
-rw-r--r-- | gdb/dwarf2/loc.c | 7 | ||||
-rw-r--r-- | gdb/dwarf2/loc.h | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/amd64-entry-value.exp | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 5b2d58a..c15221e 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -363,7 +363,8 @@ decode_debug_loc_dwo_addresses (dwarf2_per_cu_data *per_cu, const gdb_byte * dwarf2_find_location_expression (const dwarf2_loclist_baton *baton, - size_t *locexpr_length, const CORE_ADDR pc) + size_t *locexpr_length, const CORE_ADDR pc, + bool at_entry) { dwarf2_per_objfile *per_objfile = baton->per_objfile; struct objfile *objfile = per_objfile->objfile; @@ -456,7 +457,7 @@ dwarf2_find_location_expression (const dwarf2_loclist_baton *baton, loc_ptr += bytes_read; } - if (low == high && unrel_pc == low) + if (low == high && unrel_pc == low && at_entry) { /* This is entry PC record present only at entry point of a function. Verify it is really the function entry point. */ @@ -3920,7 +3921,7 @@ loclist_read_variable_at_entry (struct symbol *symbol, frame_info_ptr frame) if (frame == NULL || !get_frame_func_if_available (frame, &pc)) return value::allocate_optimized_out (symbol->type ()); - data = dwarf2_find_location_expression (dlbaton, &size, pc); + data = dwarf2_find_location_expression (dlbaton, &size, pc, true); if (data == NULL) return value::allocate_optimized_out (symbol->type ()); diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h index 5cf824d..94e1fbe 100644 --- a/gdb/dwarf2/loc.h +++ b/gdb/dwarf2/loc.h @@ -39,7 +39,8 @@ extern unsigned int entry_values_debug; const gdb_byte *dwarf2_find_location_expression (const dwarf2_loclist_baton *baton, size_t *locexpr_length, - CORE_ADDR pc); + CORE_ADDR pc, + bool at_entry = false); /* Find the frame base information for FRAMEFUNC at PC. START is an out parameter which is set to point to the DWARF expression to diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.exp b/gdb/testsuite/gdb.arch/amd64-entry-value.exp index 3c666ac..c7fea22 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value.exp +++ b/gdb/testsuite/gdb.arch/amd64-entry-value.exp @@ -77,7 +77,7 @@ gdb_continue_to_breakpoint "entry_stack: stacktest" gdb_test "bt" \ [multi_line \ - "^#0 +stacktest *\\(r1=r1@entry=1, r2=r2@entry=2, \[^\r\n\]+, s1=s1@entry=11, s2=s2@entry=12, \[^\r\n\]+, d9=d9@entry=11\\.5, da=da@entry=12\\.5\\) \[^\r\n\]*" \ + "^#0 +stacktest *\\(r1=r1@entry=1, r2=r2@entry=2, \[^\r\n\]+, s1=3, s1@entry=11, s2=4, s2@entry=12, \[^\r\n\]+, d9=3\\.5, d9@entry=11\\.5, da=4\\.5, da@entry=12\\.5\\) \[^\r\n\]*" \ "#1 +0x\[0-9a-f\]+ in main .*"] \ "entry_stack: bt at entry" |