aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-09-21 07:09:10 -0600
committerTom Tromey <tromey@adacore.com>2020-09-21 07:09:10 -0600
commit5dd918d980cbcd31a569a6577d520c9da2ef9964 (patch)
tree7eab1ecf9aa748bdc44b169eb2fab6396022d346 /gdb/sparc-tdep.c
parentc73eac969a8e14ebc5e3a1671951368728d01066 (diff)
downloadfsf-binutils-gdb-5dd918d980cbcd31a569a6577d520c9da2ef9964.zip
fsf-binutils-gdb-5dd918d980cbcd31a569a6577d520c9da2ef9964.tar.gz
fsf-binutils-gdb-5dd918d980cbcd31a569a6577d520c9da2ef9964.tar.bz2
Fix sparc prologue skipping
sparc can fail at inline prologue skipping. Andrew Burgess tracked this down to sparc32_skip_prologue, which should use skip_prologue_using_sal rather than its hand-rolled variant. I don't have a good way to test this with the gdb test suite (is there a board file for using qemu? That would help), but it fixes a regression in the internal AdaCore test suite. We've had this patch internally at AdaCore for a while, but I just now finally got around to making sure that backing it out reintroduces the problem. gdb/ChangeLog 2020-09-21 Tom Tromey <tromey@adacore.com> * sparc-tdep.c (sparc32_skip_prologue): Use skip_prologue_using_sal.
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index e9636cd..8417a47 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -1127,18 +1127,19 @@ static CORE_ADDR
sparc32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
{
struct symtab_and_line sal;
- CORE_ADDR func_start, func_end;
+ CORE_ADDR func_addr;
struct sparc_frame_cache cache;
/* This is the preferred method, find the end of the prologue by
using the debugging information. */
- if (find_pc_partial_function (start_pc, NULL, &func_start, &func_end))
+
+ if (find_pc_partial_function (start_pc, NULL, &func_addr, NULL))
{
- sal = find_pc_line (func_start, 0);
+ CORE_ADDR post_prologue_pc
+ = skip_prologue_using_sal (gdbarch, func_addr);
- if (sal.end < func_end
- && start_pc <= sal.end)
- return sal.end;
+ if (post_prologue_pc != 0)
+ return std::max (start_pc, post_prologue_pc);
}
start_pc = sparc_analyze_prologue (gdbarch, start_pc, 0xffffffffUL, &cache);