This is the mail archive of the gdb-patches@sourceware.org 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: [patch] fix for PR2424


 > With the attached patch for testsuite and the patch itself, the PR should be
 > fixed.

It's not the right fix, though, because from a console the temporary breakpoint
now gets reported when execution stops.

Currently:

  (gdb) tbreak main
  Breakpoint 1 at 0x8048687: file myprog.c, line 95.
  (gdb) run
  Starting program: /home/nickrob/myprog 
  main (argc=1, argv=0xbfcacf74) at myprog.c:95
  95      main (int argc, char **argv) {
  (gdb) 


After your change:

  (gdb) tbreak main
  Breakpoint 1 at 0x8048687: file myprog.c, line 95.
  (gdb) run
  Starting program: /home/nickrob/myprog 
  
  Breakpoint 1, main (argc=1, argv=0xbf844314) at myprog.c:95
  95      main (int argc, char **argv) {
  (gdb) 


 > Thanks,
 > 
 > Aleksandar Ristovski
 > QNX Software Systems
 > 
 > 
 > Testsuite:
 > 2008-03-05  Aleksandar Ristovski  <aristovski@qnx.com>
 > 
 > 	* gdb.mi/mi-support.exp: Add "reason" to the matching pattern. This
 > 	is to support fix for PR2424.
 > 
 > infrun.c:
 > 2008-03-05  Aleksandar Ristovski <aristovski@qnx.com>
 > 
 > 	* infrun.c (normal_stop) Move breakpoint_auto_delete further down
 > 	to allow printing to 'see' real reason of stop. This fixes PR 2424.
 > 
 > 
 > 
 > Index: gdb/testsuite/lib/mi-support.exp
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
 > retrieving revision 1.51
 > diff -r1.51 mi-support.exp
 > 893c893
 > <     -re ".*000\\*stopped,thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
 > ---
 > >     -re ".*000\\*stopped,reason=.*thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
 > Index: gdb/infrun.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/infrun.c,v
 > retrieving revision 1.266
 > diff -u -p -r1.266 infrun.c
 > --- gdb/infrun.c	29 Jan 2008 22:47:19 -0000	1.266
 > +++ gdb/infrun.c	5 Mar 2008 16:08:02 -0000
 > @@ -3151,11 +3151,6 @@ Further execution is probably impossible
 >  	}
 >      }
 >  
 > -  /* Delete the breakpoint we stopped at, if it wants to be deleted.
 > -     Delete any breakpoint that is to be deleted at the next stop.  */
 > -
 > -  breakpoint_auto_delete (stop_bpstat);
 > -
 >    /* If an auto-display called a function and that got a signal,
 >       delete that auto-display to avoid an infinite recursion.  */
 >  
 > @@ -3292,6 +3287,9 @@ Further execution is probably impossible
 >      }
 >  
 >  done:
 > +  /* Delete the breakpoint we stopped at, if it wants to be deleted.
 > +     Delete any breakpoint that is to be deleted at the next stop.  */
 > +  breakpoint_auto_delete (stop_bpstat);
 >    annotate_stopped ();
 >    observer_notify_normal_stop (stop_bpstat);
 >  }

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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