aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorCarl Love <cel@us.ibm.com>2023-03-20 16:59:33 -0400
committerCarl Love <cel@us.ibm.com>2023-03-21 11:09:24 -0400
commit70ea5a46bd926149fb4a9c3da32c2fc14f6e83c3 (patch)
tree4b694349212e43146eca5c2455adb9fab5693eb7 /gdb
parent827462caad3e8c430f546c12476dff4f6d78e0f8 (diff)
downloadgdb-70ea5a46bd926149fb4a9c3da32c2fc14f6e83c3.zip
gdb-70ea5a46bd926149fb4a9c3da32c2fc14f6e83c3.tar.gz
gdb-70ea5a46bd926149fb4a9c3da32c2fc14f6e83c3.tar.bz2
PowerPC: regression fix for reverse-finish command.
The recent commit: commit 2a8339b71f37f2d02f5b2194929c9d702ef27223 Author: Carl Love <cel@us.ibm.com> Date: Thu Mar 9 16:10:18 2023 -0500 PowerPC: fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-reverse.exp PPC64 multiple entry points, a normal entry point and an alternate entry point. The alternate entry point is to setup the Table of Contents (TOC) register before continuing at the normal entry point. When the TOC is already valid, the normal entry point is used, this is typically the case. The alternate entry point is typically referred to as the global entry point (GEP) in IBM. The normal entry point is typically referred to as the local entry point (LEP). ..... Is causing regression failures on on PowerPC platforms. The regression failures are in tests: gdb.reverse/finish-precsave.exp gdb.btrace/tailcall.exp gdb.mi/mi-reverse.exp gdb.btrace/step.exp gdb.reverse/until-precsave.exp gdb.reverse/finish-reverse.exp gdb.btrace/tailcall-only.exp The issue is in gdb/infcmd.c, function finish_command. The value of the two new variables ALT_ENTRY_POINT and ENTRY_POINT are being initializezed to SAL.PC. However, SAL has just been declared. The value of SAL.PC is zero at this point. The intialization of ALT_ENTRY_POINT and ENTRY_POINT needs to be after the initialization of SAL. This patch moves the initialization of ALT_ENTRY_POINT and ENTRY_POINT variables to fix the regression failures. The patch has been tested on Power10 and on X86.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/infcmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index f464615..e2032d1 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1710,8 +1710,8 @@ finish_backward (struct finish_command_fsm *sm)
struct thread_info *tp = inferior_thread ();
CORE_ADDR pc;
CORE_ADDR func_addr;
- CORE_ADDR alt_entry_point = sal.pc;
- CORE_ADDR entry_point = alt_entry_point;
+ CORE_ADDR alt_entry_point;
+ CORE_ADDR entry_point;
frame_info_ptr frame = get_selected_frame (nullptr);
struct gdbarch *gdbarch = get_frame_arch (frame);
@@ -1721,6 +1721,8 @@ finish_backward (struct finish_command_fsm *sm)
error (_("Cannot find bounds of current function"));
sal = find_pc_line (func_addr, 0);
+ alt_entry_point = sal.pc;
+ entry_point = alt_entry_point;
if (gdbarch_skip_entrypoint_p (gdbarch))
/* Some architectures, like PowerPC use local and global entry points.