Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFC: next/finish/etc -vs- exceptions
Date: Wed, 15 Dec 2010 21:18:00 -0000	[thread overview]
Message-ID: <m3aak6loq7.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20101211052651.GA13892@host0.dyn.jankratochvil.net> (Jan	Kratochvil's message of "Sat, 11 Dec 2010 06:26:51 +0100")

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Tom> Here is what I am testing.

Jan> OK.  Included a ChangeLog entry.

Thanks.

I had to modify the test a little to make it pass with gcc svn trunk.
It seems the test was a bit confused about the line number it was on.

Here is what I am checking in.

Tom

2010-12-15  Tom Tromey  <tromey@redhat.com>

	* infrun.c (save_infcall_control_state): Handle the
	exception-resume breakpoint.
	(restore_infcall_control_state): Likewise.
	(discard_infcall_control_state): Likewise.

2010-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.cp/nextoverthrow.cc (dummy): Return int 0.
	(NextOverThrowDerivates) <resumebpt>: New.
	(resumebpt_test): New.
	(main): Call resumebpt_test.
	* gdb.cp/nextoverthrow.exp: New block for test of "resumebpt".

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.461
diff -u -r1.461 infrun.c
--- infrun.c	9 Dec 2010 16:09:52 -0000	1.461
+++ infrun.c	15 Dec 2010 21:15:45 -0000
@@ -6379,6 +6379,7 @@
   inf_status->inferior_control = inf->control;
 
   tp->control.step_resume_breakpoint = NULL;
+  tp->control.exception_resume_breakpoint = NULL;
 
   /* Save original bpstat chain to INF_STATUS; replace it in TP with copy of
      chain.  If caller's caller is walking the chain, they'll be happier if we
@@ -6428,6 +6429,10 @@
   if (tp->control.step_resume_breakpoint)
     tp->control.step_resume_breakpoint->disposition = disp_del_at_next_stop;
 
+  if (tp->control.exception_resume_breakpoint)
+    tp->control.exception_resume_breakpoint->disposition
+      = disp_del_at_next_stop;
+
   /* Handle the bpstat_copy of the chain.  */
   bpstat_clear (&tp->control.stop_bpstat);
 
@@ -6476,6 +6481,10 @@
     inf_status->thread_control.step_resume_breakpoint->disposition
       = disp_del_at_next_stop;
 
+  if (inf_status->thread_control.exception_resume_breakpoint)
+    inf_status->thread_control.exception_resume_breakpoint->disposition
+      = disp_del_at_next_stop;
+
   /* See save_infcall_control_state for info on stop_bpstat. */
   bpstat_clear (&inf_status->thread_control.stop_bpstat);
 
Index: testsuite/gdb.cp/nextoverthrow.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/nextoverthrow.cc,v
retrieving revision 1.1
diff -u -r1.1 nextoverthrow.cc
--- testsuite/gdb.cp/nextoverthrow.cc	9 Dec 2010 16:09:53 -0000	1.1
+++ testsuite/gdb.cp/nextoverthrow.cc	15 Dec 2010 21:15:47 -0000
@@ -19,8 +19,9 @@
 
 using namespace std;
 
-void dummy ()
+int dummy ()
 {
+  return 0;
 }
 
 class NextOverThrowDerivates
@@ -89,10 +90,39 @@
     function1 (val);		// until here
   }
 
+  void resumebpt (int val)
+  {
+    try
+      {
+	throw val;
+      }
+    catch (int x)
+      {
+	dummy ();
+      }
+  }
+
 };
 NextOverThrowDerivates next_cases;
 
 
+int
+resumebpt_test (int x)
+{
+  try
+    {
+      next_cases.resumebpt (x);	    // Start: resumebpt
+      next_cases.resumebpt (x + 1); // Second: resumebpt
+    }
+  catch (int val)
+    {
+      dummy ();
+      x = val;
+    }
+
+  return x;
+}
+
 int main () 
 { 
   int testval = -1;
@@ -198,6 +228,8 @@
       testval = val;		// End: advance
     }
 
+  // Test of "resumebpt".
+  testval = resumebpt_test (10);
+
   testval = 32;			// done
 }
-
Index: testsuite/gdb.cp/nextoverthrow.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/nextoverthrow.exp,v
retrieving revision 1.1
diff -u -r1.1 nextoverthrow.exp
--- testsuite/gdb.cp/nextoverthrow.exp	9 Dec 2010 16:09:53 -0000	1.1
+++ testsuite/gdb.cp/nextoverthrow.exp	15 Dec 2010 21:15:47 -0000
@@ -149,5 +149,14 @@
 tbreak_and_cont "End: advance"
 verify_testval "pre-check - advance" 8
 
+tbreak_and_cont "Start: resumebpt"
+gdb_test "tbreak _Unwind_RaiseException"
+gdb_test "continue" "Temporary breakpoint.*" "continuing to _Unwind_RaiseException"
+gdb_test "finish" "Run till exit .*"
+gdb_test {set $retpc=$pc}
+gdb_test {break *$retpc if dummy ()}
+tbreak_and_cont "Second: resumebpt"
+gdb_test "next"
+
 tbreak_and_cont "done"
-verify_testval "post-check - advance" 9
+verify_testval "post-check - advance" 10


  reply	other threads:[~2010-12-15 21:18 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07  1:37 Tom Tromey
2010-11-24 17:53 ` Joel Brobecker
2010-11-24 18:24   ` Tom Tromey
2010-11-25  7:59 ` Jan Kratochvil
2010-11-27 17:25   ` Doug Evans
2010-11-28  8:29     ` Joel Brobecker
2010-11-30 16:43   ` Tom Tromey
2010-11-30 17:02     ` Jan Kratochvil
2010-11-30 17:15       ` Phil Muldoon
2010-11-30 20:15     ` Tom Tromey
2010-12-01 13:42       ` Jan Kratochvil
2010-12-01 21:40     ` Tom Tromey
2010-11-30 18:23   ` Tom Tromey
2010-11-30 18:55     ` Tom Tromey
2010-12-02 15:32 ` Tom Tromey
2010-12-09 16:37   ` Tom Tromey
2010-12-10  4:52     ` Jan Kratochvil
2010-12-10 20:07       ` Tom Tromey
2010-12-11  5:27         ` Jan Kratochvil
2010-12-15 21:18           ` Tom Tromey [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-05-29 22:32 Tom Tromey
2009-05-30 21:08 ` Doug Evans
2009-05-30 23:18   ` Tom Tromey
2009-06-10 16:13 ` Joel Brobecker
2009-06-10 16:50   ` Tom Tromey
2009-06-10 17:05     ` Pedro Alves
2009-06-10 17:13       ` Daniel Jacobowitz
2009-06-10 17:47         ` Pedro Alves
2009-06-10 18:32           ` Tom Tromey
2009-06-10 18:49             ` Pedro Alves
2009-06-12 20:49           ` Tom Tromey
2009-06-12 21:51             ` Pedro Alves
2009-06-12 22:07               ` Pedro Alves
2010-11-25  4:54         ` Jan Kratochvil
2009-06-11 14:45     ` Joel Brobecker
2009-06-11 15:47       ` Tom Tromey
2009-07-24 17:38 ` Tom Tromey
2009-07-24 18:54   ` Pedro Alves
2009-07-24 19:18     ` Tom Tromey
2009-09-09 18:56     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3aak6loq7.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox