From a88ee931eee4ba7339c481735b9405f66161e2f6 Mon Sep 17 00:00:00 2001 From: WANG Rui Date: Sat, 22 Apr 2023 07:50:08 +0200 Subject: gdb: Fix false match issue in skip_prologue_using_linetable [ Changes in v2: - rebase on trunk Changes in v3: - add test-case ] We should exclude matches to the ending PC to prevent false matches with the next function, as prologue_end is located at the end PC. : 0x00: ... <-- start_pc 0x04: ... 0x08: ... <-- breakpoint 0x0c: ret : 0x10: ret <-- end_pc | prologue_end of fun2 Tested on x86_64-linux. Co-Authored-By: WANG Rui (fix, tiny change [1]) Co-Authored-By: Tom de Vries (test-case) Approved-by: Kevin Buettner [1] https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html PR symtab/30369 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30369 --- gdb/symtab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/symtab.c') diff --git a/gdb/symtab.c b/gdb/symtab.c index 9e1e8e9..27611a3 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3715,7 +3715,7 @@ skip_prologue_using_linetable (CORE_ADDR func_addr) for (; (it < linetable->item + linetable->nitems - && it->raw_pc () <= unrel_end); + && it->raw_pc () < unrel_end); it++) if (it->prologue_end) return {it->pc (objfile)}; -- cgit v1.1