From 95f21c0d25a8241251a1dfcf6e5d80701cd80a06 Mon Sep 17 00:00:00 2001 From: Pawel Kupczak Date: Thu, 28 Aug 2025 11:50:16 +0000 Subject: gdb, amd64: return after amd64_analyze_register_saves if current_pc reached Make sure the function bails out early if CURRENT_PC is reached, to avoid the call to amd64_analyze_stack_alloc. Reviewed-By: Guinevere Larsen Approved-By: Andrew Burgess --- gdb/amd64-tdep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 1afdaa8..9245889 100755 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -2750,6 +2750,9 @@ amd64_analyze_prologue (gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, return current_pc; pc = amd64_analyze_register_saves (pc, current_pc, cache); + if (current_pc <= pc) + return current_pc; + return amd64_analyze_stack_alloc (gdbarch, pc, current_pc, cache); } -- cgit v1.1