public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Fix false match issue in skip_prologue_using_linetable
@ 2023-04-17 16:24 WANG Rui
  2023-04-17 17:38 ` Keith Seitz
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: WANG Rui @ 2023-04-17 16:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX, WANG Rui

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.

  <fun1>:
    0x00: ... <-- start_pc
    0x04: ...
    0x08: ... <-- breakpoint
    0x0c: ret
  <fun2>:
    0x10: ret <-- end_pc | prologue_end of fun2
---
 gdb/symtab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/symtab.c b/gdb/symtab.c
index f2b1a14e006..a662d7d1869 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3735,7 +3735,7 @@ skip_prologue_using_linetable (CORE_ADDR func_addr)
 	 });
 
       for (;
-	   it < linetable->item + linetable->nitems && it->pc <= end_pc;
+	   it < linetable->item + linetable->nitems && it->pc < end_pc;
 	   it++)
 	if (it->prologue_end)
 	  return {it->pc};
-- 
2.40.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-04-23  1:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 16:24 [PATCH] gdb: Fix false match issue in skip_prologue_using_linetable WANG Rui
2023-04-17 17:38 ` Keith Seitz
2023-04-18  2:26   ` hev
2023-04-18  8:43     ` Tom de Vries
2023-04-18  9:59       ` hev
2023-04-17 21:12 ` Lancelot SIX
2023-04-18  2:26   ` hev
2023-04-22  8:36 ` Tom de Vries
2023-04-23  1:24   ` hev

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).