From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14890 invoked by alias); 10 Mar 2008 17:36:37 -0000 Received: (qmail 14881 invoked by uid 22791); 10 Mar 2008 17:36:36 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 10 Mar 2008 17:36:14 +0000 Received: (qmail 17736 invoked from network); 10 Mar 2008 17:36:06 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 10 Mar 2008 17:36:06 -0000 From: Vladimir Prus To: Aleksandar Ristovski Subject: Re: [patch] fix for PR2424 Date: Mon, 10 Mar 2008 17:36:00 -0000 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Cc: gdb-patches@sources.redhat.com, nickrob@snap.net.nz References: <47CED9FB.7090904@qnx.com> <200803101745.16451.vladimir@codesourcery.com> <47D56D4E.5040902@qnx.com> In-Reply-To: <47D56D4E.5040902@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200803102036.05829.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00102.txt.bz2 On Monday 10 March 2008 20:18:06 Aleksandar Ristovski wrote: > Vladimir Prus wrote: > >=20 > > I think this is good. You did not attach your patches, so I cannot comm= ent on > > the code itself. > Patches attached. > >=20 > > Also, since this code touches infrun.c and affects CLI, I think some of= the > > global maintainers will have to approve it. >=20 > The proposed patch (attached) will produce the following outputs: >=20 > CLI: > (gdb) tbreak main > Temporary breakpoint 1 at 0x80483a0: file ./main.c, line 15. > (gdb) r > Starting program: /space/src/testcases/sigsegv/main >=20 > Temporary breakpoint 1, main () at ./main.c:15 > 15 =A0 =A0 =A0 =A0foo (p); >=20 > MI: > (gdb) > -break-insert -t main > ^done,bkpt=3D{number=3D"1",type=3D"breakpoint",disp=3D"del",enabled=3D"y"= ,addr=3D"0x080483a0",func=3D"main",file=3D"./main.c",fullname=3D"/space/src= /testcases/sigsegv/main.c",line=3D"15",times=3D"0"} > (gdb) > -exec-run > ^running > (gdb) > *stopped,reason=3D"breakpoint-hit",disp=3D"del",bkptno=3D"1",thread-id=3D= "0",frame=3D{addr=3D"0x080483a0",func=3D"main",args=3D[],file=3D"./main.c",= fullname=3D"/space/src/testcases/sigsegv/main.c",line=3D"15"} >=20 >=20 >=20 >=20 > ----- ChangeLog > 2008-03-10 =A0Aleksandar Ristovski >=20 > =A0=A0=A0=A0=A0=A0=A0=A0* infrun.c (normal_stop) Move breakpoint_auto_del= ete further down > =A0=A0=A0=A0=A0=A0=A0=A0to allow printing to 'see' real reason of stop. T= his fixes PR 2424. > =A0=A0=A0=A0=A0=A0=A0=A0* breakpoint.c (print_it_typical): Print "Tempora= ry breakpoint" instead > =A0=A0=A0=A0=A0=A0=A0=A0of just "Breakpoint" when breakpoint is, well, te= mporary. > =A0=A0=A0=A0=A0=A0=A0=A0(mention): Likewise. >=20 > ----- testsuite ChangeLog > 2008-03-10 =A0Aleksandar Ristovski =A0 >=20 > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/attach.exp (proc_do_attach_tests): Mat= ching pattern for > =A0=A0=A0=A0=A0=A0=A0=A0temporary breakpoint to match "Temporary breakpoi= nt". > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/break.exp (delete_breakpoints): Likewi= se. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/call-ar-st.exp (get_debug_format): Lik= ewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/commands.exp (temporary_breakpoint_com= mands): Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/display.exp: Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/foll-exec.exp (do_exec_tests): Likewis= e. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/restore.exp (restore_tests): Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/sepdebug.exp: Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.base/watchpoint.exp: Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.mi/mi-pending.exp: Matching pattern for new= "disp" field. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.mi/mi-simplerun.exp (test_running_the_progr= am): Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.mi/mi-until.exp (test_runnint_to_foo): Like= wise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.mi/mi-var-display.exp: Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.mi/mi2-simplerun.exp (test_running_the_prog= ram): Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.mi/mi2-until.exp (test_running_to_foo): Lik= ewise. > =A0=A0=A0=A0=A0=A0=A0=A0* gdb.mi/mi2-var-display.exp: Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* lib/gdb.exp (gdb_breakpoint): Likewise. > =A0=A0=A0=A0=A0=A0=A0=A0* lib/mi-support.exp: Add "reason" and "disp" fie= lds to the matching > =A0=A0=A0=A0=A0=A0=A0=A0pattern. This is to support fix for PR2424. >=20 >=20 > PR2424.diff > Index: gdb/infrun.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/infrun.c,v > retrieving revision 1.266 > diff -u -p -r1.266 infrun.c > --- gdb/infrun.c=A0=A0=A0=A0=A0=A0=A0=A029 Jan 2008 22:47:19 -0000=A0=A0= =A0=A0=A0=A01.266 > +++ gdb/infrun.c=A0=A0=A0=A0=A0=A0=A0=A010 Mar 2008 15:24:07 -0000 > @@ -3151,11 +3151,6 @@ Further execution is probably impossible > =A0=A0=A0=A0=A0=A0=A0=A0} > =A0 =A0 =A0} > =A0 > - =A0/* Delete the breakpoint we stopped at, if it wants to be deleted. > - =A0 =A0 Delete any breakpoint that is to be deleted at the next stop. = =A0*/ > - > - =A0breakpoint_auto_delete (stop_bpstat); > - > =A0 =A0/* If an auto-display called a function and that got a signal, > =A0 =A0 =A0 delete that auto-display to avoid an infinite recursion. =A0*/ > =A0 > @@ -3294,6 +3289,9 @@ Further execution is probably impossible > =A0done: > =A0 =A0annotate_stopped (); > =A0 =A0observer_notify_normal_stop (stop_bpstat); > + =A0/* Delete the breakpoint we stopped at, if it wants to be deleted. > + =A0 =A0 Delete any breakpoint that is to be deleted at the next stop. = =A0*/ > + =A0breakpoint_auto_delete (stop_bpstat); > =A0} > =A0 > =A0static int > Index: gdb/breakpoint.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/breakpoint.c,v > retrieving revision 1.304 > diff -u -p -r1.304 breakpoint.c > --- gdb/breakpoint.c=A0=A0=A0=A027 Feb 2008 20:27:49 -0000=A0=A0=A0=A0=A0= =A01.304 > +++ gdb/breakpoint.c=A0=A0=A0=A010 Mar 2008 15:24:10 -0000 > @@ -2131,6 +2131,7 @@ print_it_typical (bpstat bs) > =A0 =A0struct breakpoint *b; > =A0 =A0const struct bp_location *bl; > =A0 =A0struct ui_stream *stb; > + =A0int bp_temp =3D 0; =A0 > =A0 =A0stb =3D ui_out_stream_new (uiout); > =A0 =A0old_chain =3D make_cleanup_ui_out_stream_delete (stb); > =A0 =A0/* bs->breakpoint_at can be NULL if it was a momentary breakpoint > @@ -2144,15 +2145,22 @@ print_it_typical (bpstat bs) > =A0 =A0 =A0{ > =A0 =A0 =A0case bp_breakpoint: > =A0 =A0 =A0case bp_hardware_breakpoint: > + =A0 =A0 =A0bp_temp =3D bs->breakpoint_at->owner->disposition =3D=3D dis= p_del; > =A0 =A0 =A0 =A0if (bl->address !=3D bl->requested_address) > =A0=A0=A0=A0=A0=A0=A0=A0breakpoint_adjustment_warning (bl->requested_addr= ess, > =A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 bl->address, > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 =A0 =A0 =A0 b->number, 1); > =A0 =A0 =A0 =A0annotate_breakpoint (b->number); > - =A0 =A0 =A0ui_out_text (uiout, "\nBreakpoint "); > + =A0 =A0 =A0if (bp_temp)=20 > +=A0=A0=A0=A0=A0=A0=A0ui_out_text (uiout, "\nTemporary breakpoint "); > + =A0 =A0 =A0else > +=A0=A0=A0=A0=A0=A0=A0ui_out_text (uiout, "\nBreakpoint "); > =A0 =A0 =A0 =A0if (ui_out_is_mi_like_p (uiout)) > -=A0=A0=A0=A0=A0=A0=A0ui_out_field_string (uiout, "reason",=20 > -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0 =A0 async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); > +=A0=A0=A0=A0=A0=A0=A0{ > +=A0=A0=A0=A0=A0=A0=A0 =A0ui_out_field_string (uiout, "reason",=20 > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT)); > +=A0=A0=A0=A0=A0=A0=A0 =A0ui_out_field_string (uiout, "disp", bp_temp ? "= del" : "keep"); > +=A0=A0=A0=A0=A0=A0=A0} For consistency, it's better to use same printing of 'disp' as done in print_one_breakpoint_location: ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]); bpdisps is actually a table local to print_one_breakpoint_location, but there's no reason why it cannot be made a global table. - Volodya