gdb/1473: calling functions in a statically linked binary fails

Paul Brook paul@codesourcery.com
Wed Dec 17 23:22:00 GMT 2003


Patch below fixed PR gdb/1473.

What was happening is the breakpoint for the end of a hand-called function is 
set to the same location as the breakpoint for monitoring shared library 
activity. However, when the breakpoint is hit gdb sees the shlib breakpoint 
and resumes execution.

Patch below fixes this by checking it we've hit a dummy call return breakpoint 
before resuming execition. The case of an normal breakpoint and shlib 
breakpoint at the same location still doesn't work, but that's less critical.

Ok?

Paul

2003-12-17  Paul Brook  <paul@codesourcery.com>

	PR gdb/1473
	* infrun.c (keep_going): Check stop_stack_dummy.

Index: gdb/infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.122
diff -u -p -r1.122 infrun.c
--- gdb/infrun.c	25 Nov 2003 16:01:36 -0000	1.122
+++ gdb/infrun.c	17 Dec 2003 22:37:44 -0000
@@ -2876,6 +2876,14 @@ stop_stepping (struct execution_control_
 static void
 keep_going (struct execution_control_state *ecs)
 {
+  /* If we've hit a dummy stack breakpoint then stop,
+     even though we would normally keep going.  */
+  if (stop_stack_dummy)
+    {
+      stop_stepping (ecs);
+      return;
+    }
+
   /* Save the pc before execution, to compare with pc after stop.  */
   prev_pc = read_pc ();		/* Might have been DECR_AFTER_BREAK */
 



More information about the Gdb-patches mailing list