This is the mail archive of the gdb-prs@sources.redhat.com 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]

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


The following reply was made to PR gdb/1473; it has been noted by GNATS.

From: Paul Brook <paul@codesourcery.com>
To: gdb-gnats@sources.redhat.com, wim.yedema@philips.com,
	gdb-prs@sources.redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: gdb/1473: calling functions in a statically linked binary fails
Date: Wed, 17 Dec 2003 23:22:08 +0000

 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 */
  
 


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