This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Don't skip over return trampolines when instruction-stepping


 I don't think "stepi" should ever execute more than one instruction 
(special cases like branch delay slots excepted).  However the return 
trampoline code skips over such pieces in one go even in the 
instruction-stepping mode.

 Here's a fix to address this problem.  Unfortunately this hook is 
currently only used by two platforms -- RS6000/AIX and PA-RISC/HP-UX -- 
both of which are too exotic for me to test, but the change should be 
obvious anyway.

 The test suite doesn't really cover instruction-stepping (being too 
architecture-specific for generic coverage), but this was noticed in 
manual MIPS16 testing with one of the followup changes that uses the 
return trampoline hook to handle MIPS16 return thunks.

 OK to apply?

2011-12-06  Maciej W. Rozycki  <>
            Maciej W. Rozycki  <>

	* infrun.c (handle_inferior_event): Don't proceed through
	shared library trampolines if stepping at the machine
	instruction level.


Index: gdb-fsf-trunk-quilt/gdb/infrun.c
--- gdb-fsf-trunk-quilt.orig/gdb/infrun.c	2011-11-08 11:25:58.635899589 +0000
+++ gdb-fsf-trunk-quilt/gdb/infrun.c	2011-11-08 11:26:07.545882458 +0000
@@ -5009,7 +5009,8 @@ handle_inferior_event (struct execution_
   /* If we're in the return path from a shared library trampoline,
      we want to proceed through the trampoline when stepping.  */
   if (gdbarch_in_solib_return_trampoline (gdbarch,
-					  stop_pc, ecs->stop_func_name))
+					  stop_pc, ecs->stop_func_name)
+      && ecs->event_thread->control.step_over_calls != STEP_OVER_NONE)
       /* Determine where this trampoline returns.  */
       CORE_ADDR real_stop_pc;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]