[binutils-gdb] gdb, amd64: return after amd64_analyze_frame_setup if current_pc reached

Christina Schimpe cschimpe@sourceware.org
Thu Sep 4 20:57:52 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8862ee58868fc018b6fe179c3b6d61c30867d541

commit 8862ee58868fc018b6fe179c3b6d61c30867d541
Author: Pawel Kupczak <pawel.kupczak@intel.com>
Date:   Thu Aug 28 11:50:14 2025 +0000

    gdb, amd64: return after amd64_analyze_frame_setup if current_pc reached
    
    Make sure the function bails out early if CURRENT_PC is reached, to
    avoid the call to amd64_analyze_register_saves.
    
    Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
    Approved-By: Andrew Burgess <aburgess@redhat.com>

Diff:
---
 gdb/amd64-tdep.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 47eb2ec3026..b69256509d9 100755
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -2681,6 +2681,9 @@ amd64_analyze_prologue (gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc,
     return current_pc;
 
   pc = amd64_analyze_frame_setup (gdbarch, pc, current_pc, cache);
+  if (current_pc <= pc)
+    return current_pc;
+
   return amd64_analyze_register_saves (pc, current_pc, cache);
 }


More information about the Gdb-cvs mailing list