public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-pmuldoon-next-over-throw2: test case updates as suggested by Jan
@ 2010-11-30 15:46 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2010-11-30 15:46 UTC (permalink / raw)
  To: archer-commits

The branch, archer-pmuldoon-next-over-throw2 has been updated
       via  6b808ead605d6287bd35447ad5a6b383524086f8 (commit)
       via  338f26aa4b04f8bfd14a9134321f2c8e28b11dd2 (commit)
       via  ee589dd760b2939849590d63e45185bff6c7a5db (commit)
       via  6912373f9b313b443ecb651887b4bf583eda8ce8 (commit)
      from  f772d5a898c9cd7312eb13315568a1a1a1445df8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 6b808ead605d6287bd35447ad5a6b383524086f8
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Nov 30 08:45:54 2010 -0700

    test case updates as suggested by Jan

commit 338f26aa4b04f8bfd14a9134321f2c8e28b11dd2
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Nov 30 08:05:18 2010 -0700

    rename the new test case

commit ee589dd760b2939849590d63e45185bff6c7a5db
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Nov 30 07:55:33 2010 -0700

    use RETURN_MASK_ERROR

commit 6912373f9b313b443ecb651887b4bf583eda8ce8
Author: Tom Tromey <tromey@redhat.com>
Date:   Tue Nov 30 07:18:42 2010 -0700

    Make set_longjmp_breakpoint also set initiating_frame

-----------------------------------------------------------------------

Summary of changes:
 gdb/breakpoint.c                                   |   11 ++-
 gdb/breakpoint.h                                   |    3 +-
 gdb/infcmd.c                                       |   10 +--
 gdb/infrun.c                                       |    4 +-
 .../gdb.cp/{gdb9593.cc => nextoverthrow.cc}        |    2 +-
 .../gdb.cp/{gdb9593.exp => nextoverthrow.exp}      |   76 ++++++++------------
 gdb/testsuite/gdb.java/jnpe.exp                    |   24 +++----
 gdb/testsuite/gdb.java/jnpe.java                   |    2 +-
 8 files changed, 58 insertions(+), 74 deletions(-)
 rename gdb/testsuite/gdb.cp/{gdb9593.cc => nextoverthrow.cc} (97%)
 rename gdb/testsuite/gdb.cp/{gdb9593.exp => nextoverthrow.exp} (69%)

First 500 lines of diff:
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index f1896a8..8e64655 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5603,12 +5603,14 @@ make_breakpoint_permanent (struct breakpoint *b)
 }
 
 /* Call this routine when stepping and nexting to enable a breakpoint
-   if we do a longjmp() or 'throw' in THREAD.  */
+   if we do a longjmp() or 'throw' in TP.  FRAME is the frame which
+   initiated the operation.  */
 
 void
-set_longjmp_breakpoint (int thread)
+set_longjmp_breakpoint (struct thread_info *tp, struct frame_id frame)
 {
   struct breakpoint *b, *temp;
+  int thread = tp->num;
 
   /* To avoid having to rescan all objfile symbols at every step,
      we maintain a list of continually-inserted but always disabled
@@ -5624,6 +5626,8 @@ set_longjmp_breakpoint (int thread)
 	clone->type = b->type == bp_longjmp_master ? bp_longjmp : bp_exception;
 	clone->thread = thread;
       }
+
+  tp->initiating_frame = frame;
 }
 
 /* Delete all longjmp breakpoints from THREAD.  */
@@ -8487,8 +8491,7 @@ until_break_command (char *arg, int from_tty, int anywhere)
 					      bp_until);
       make_cleanup_delete_breakpoint (breakpoint2);
 
-      set_longjmp_breakpoint (thread);
-      tp->initiating_frame = frame_unwind_caller_id (frame);
+      set_longjmp_breakpoint (tp, frame_unwind_caller_id (frame));
       make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
     }
 
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 83c4498..6eadb34 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -902,7 +902,8 @@ extern int detach_breakpoints (int);
    this PSPACE anymore.  */
 extern void breakpoint_program_space_exit (struct program_space *pspace);
 
-extern void set_longjmp_breakpoint (int thread);
+extern void set_longjmp_breakpoint (struct thread_info *tp,
+				    struct frame_id frame);
 extern void delete_longjmp_breakpoint (int thread);
 
 extern void enable_overlay_breakpoints (void);
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index d213f6a..ca7d094 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -867,8 +867,7 @@ step_1 (int skip_subroutines, int single_inst, char *count_string)
       if (in_thread_list (inferior_ptid))
  	thread = pid_to_thread_id (inferior_ptid);
 
-      set_longjmp_breakpoint (thread);
-      tp->initiating_frame = get_frame_id (get_current_frame ());
+      set_longjmp_breakpoint (tp, get_frame_id (get_current_frame ()));
 
       make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
     }
@@ -1228,6 +1227,7 @@ static void
 until_next_continuation (void *arg)
 {
   struct thread_info *tp = arg;
+
   delete_longjmp_breakpoint (tp->num);
 }
 
@@ -1284,8 +1284,7 @@ until_next_command (int from_tty)
 
   tp->step_multi = 0;		/* Only one call to proceed */
 
-  set_longjmp_breakpoint (thread);
-  tp->initiating_frame = get_frame_id (frame);
+  set_longjmp_breakpoint (tp, get_frame_id (frame));
   old_chain = make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
 
   proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
@@ -1584,8 +1583,7 @@ finish_forward (struct symbol *function, struct frame_info *frame)
 
   old_chain = make_cleanup_delete_breakpoint (breakpoint);
 
-  set_longjmp_breakpoint (thread);
-  tp->initiating_frame = get_frame_id (frame);
+  set_longjmp_breakpoint (tp, get_frame_id (frame));
   make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
 
   tp->proceed_to_finish = 1;    /* We want stop_registers, please...  */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index bb53b6b..f6464d4 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -5155,7 +5155,7 @@ insert_exception_resume_breakpoint (struct thread_info *tp,
   struct gdb_exception e;
 
   /* We want to ignore errors here.  */
-  TRY_CATCH (e, RETURN_MASK_ALL)
+  TRY_CATCH (e, RETURN_MASK_ERROR)
     {
       struct symbol *vsym;
       struct value *value;
@@ -5192,7 +5192,7 @@ check_exception_resume (struct execution_control_state *ecs,
 {
   struct gdb_exception e;
 
-  TRY_CATCH (e, RETURN_MASK_ALL)
+  TRY_CATCH (e, RETURN_MASK_ERROR)
     {
       struct block *b;
       struct dict_iterator iter;
diff --git a/gdb/testsuite/gdb.cp/gdb9593.cc b/gdb/testsuite/gdb.cp/nextoverthrow.cc
similarity index 97%
rename from gdb/testsuite/gdb.cp/gdb9593.cc
rename to gdb/testsuite/gdb.cp/nextoverthrow.cc
index 783c962..c9a36e6 100644
--- a/gdb/testsuite/gdb.cp/gdb9593.cc
+++ b/gdb/testsuite/gdb.cp/nextoverthrow.cc
@@ -1,6 +1,6 @@
 /* This testcase is part of GDB, the GNU debugger.
 
-   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/nextoverthrow.exp
similarity index 69%
rename from gdb/testsuite/gdb.cp/gdb9593.exp
rename to gdb/testsuite/gdb.cp/nextoverthrow.exp
index 3dad7ca..e03719f 100644
--- a/gdb/testsuite/gdb.cp/gdb9593.exp
+++ b/gdb/testsuite/gdb.cp/nextoverthrow.exp
@@ -1,4 +1,4 @@
-# Copyright 2008, 2009 Free Software Foundation, Inc.
+# Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,35 +20,21 @@ if $tracelevel then {
 
 if { [skip_cplus_tests] } { continue }
 
-set testfile "gdb9593"
+set testfile "nextoverthrow"
 set srcfile ${testfile}.cc
 set binfile $objdir/$subdir/$testfile
 
 # Create and source the file that provides information about the compiler
 # used to compile the test case.
 if [get_compiler_info ${binfile} "c++"] {
-    untested gdb9593.exp
+    untested nextoverthrow.exp
     return -1
 }
 
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-    untested gdb9593.exp
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-# Some targets can't do function calls, so don't even bother with this
-# test.
-if [target_info exists gdb,cannot_call_functions] {
-    setup_xfail "*-*-*" 9593
-    fail "This target can not call functions"
-    continue
-}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 if ![runto_main] then {
     perror "couldn't run to main"
     continue
@@ -67,116 +53,116 @@ gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" {
     }
 }
 if {!$ok} {
-    untested gdb9593.exp
+    unsupported "nextoverthrow.exp could not find _Unwind_DebugHook"
     return -1
 }
 
 # See http://sourceware.org/bugzilla/show_bug.cgi?id=9593
 
 gdb_test "next" \
-    ".*catch (...).*" \
+    "catch (...).*" \
     "next over a throw 1"
 
 gdb_test "next" \
-  ".*next_cases.function2.*" \
+  "next_cases.function2.*" \
   "next past catch 1"
 
 gdb_test "next" \
-    ".*catch (...).*" \
+    "catch (...).*" \
     "next over a throw 2"
 
 gdb_test "next" \
-  ".*next_cases.function2.*" \
+  "next_cases.function2.*" \
   "next past catch 2"
 
 gdb_test "step" \
-  ".*function1().*" \
+  "function1().*" \
   "step into function2 1"
 
 gdb_test "next" \
-    ".*catch (...).*" \
+    "catch (...).*" \
     "next over a throw 3"
 
 gdb_test "next" \
-  ".*next_cases.function3.*" \
+  "next_cases.function3.*" \
   "next past catch 3"
 
 gdb_test "next" \
-  ".*next_cases.rethrow.*" \
+  "next_cases.rethrow.*" \
     "next over a throw 4"
 
 gdb_test "next" \
-  ".*catch (...).*" \
+  "catch (...).*" \
   "next over a rethrow"
 
 gdb_test "next" \
-  ".*next_cases.function2.*" \
+  "next_cases.function2.*" \
   "next after a rethrow"
 
 gdb_test "step" \
-  ".*function1().*" \
+  "function1().*" \
   "step into function2 2"
 
 gdb_test "finish" \
-  ".*catch (...).*" \
+  "catch (...).*" \
   "finish 1"
 
 gdb_test "next" \
-  ".*next_cases.finish ().*" \
+  "next_cases.finish ().*" \
   "next past catch 4"
 
 gdb_test "step" \
-  ".*function1 ().*" \
+  "function1 ().*" \
   "step into finish method"
 
 gdb_test "finish" \
-  ".*catch (...).*" \
+  "catch (...).*" \
   "finish 2"
 
 gdb_test "next" \
-  ".*next_cases.finish ().*" \
+  "next_cases.finish ().*" \
   "next past catch 5"
 
 gdb_test "step" \
-  ".*function1 ().*" \
+  "function1 ().*" \
   "step into finish, for until"
 
 gdb_test "until" \
-  ".*function1 ().*" \
+  "function1 ().*" \
   "until with no argument 1"
 
 set line [gdb_get_line_number "marker for until" $testfile.cc]
 
 gdb_test "until $line" \
-  ".*function1 ().*" \
+  "function1 ().*" \
   "next past catch 6"
 
 gdb_test "until" \
-  ".*catch (...).*" \
+  "catch (...).*" \
   "until with no argument 2"
 
 set line [gdb_get_line_number "until here" $testfile.cc]
 
 gdb_test "next" \
-  ".*next_cases.until ().*" \
+  "next_cases.until ().*" \
   "next past catch 6"
 
 gdb_test "step" \
-  ".*function1 ().*" \
+  "function1 ().*" \
   "step into until"
 
 gdb_test "until $line" \
-  ".*catch (...).*" \
+  "catch (...).*" \
   "until-over-throw"
 
 gdb_test "next" \
-  ".*next_cases.until ().*" \
+  "next_cases.until ().*" \
   "next past catch 7"
 
 gdb_test "step" \
-  ".*function1 ().*" \
+  "function1 ().*" \
   "step into until, for advance"
 
 gdb_test "advance $line" \
-  ".*catch (...).*" \
+  "catch (...).*" \
   "advance-over-throw"
diff --git a/gdb/testsuite/gdb.java/jnpe.exp b/gdb/testsuite/gdb.java/jnpe.exp
index 55aa80d..10ce365 100644
--- a/gdb/testsuite/gdb.java/jnpe.exp
+++ b/gdb/testsuite/gdb.java/jnpe.exp
@@ -1,4 +1,4 @@
-# Copyright 2009 Free Software Foundation, Inc.
+# Copyright 2009, 2010 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -29,17 +29,13 @@ if  { [compile_java_from_source ${srcdir}/$subdir/${srcfile} ${binfile} "-g"] !=
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $testfile
 
 set line [gdb_get_line_number "break here" $testfile.java]
-gdb_test "break $testfile.java:$line" ""
-
-gdb_test "run" \
-  "// break here.*" \
-  "run java next-over-throw"
+if ![runto "$testfile.java:$line"] then {
+    perror "couldn't run to jnpe.main"
+    continue
+} 
 
 # See whether we have the needed unwinder hooks.
 set ok 1
@@ -55,7 +51,7 @@ gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook in java" {
     }
 }
 if {!$ok} {
-    untested jnpe.exp
+    unsupported "jnpe.exp could not find _Unwind_DebugHook"
     return -1
 }
 
@@ -63,11 +59,11 @@ gdb_test "handle SIGSEGV nostop noprint" \
   "SIGSEGV.*fault" \
   "disable SIGSEGV for next-over-NPE"
 
-# The line where we stop differ according to gcj; check just we did not already
-# execute the catch point.
+# The line where we stop differs according to gcj; check just we did
+# not already execute the catch point.
 
 gdb_test "next" \
-  "" \
+  ".*" \
   "next over NPE"
 
 gdb_breakpoint [gdb_get_line_number "catch point"]
diff --git a/gdb/testsuite/gdb.java/jnpe.java b/gdb/testsuite/gdb.java/jnpe.java
index 3524830..bd28d96 100644
--- a/gdb/testsuite/gdb.java/jnpe.java
+++ b/gdb/testsuite/gdb.java/jnpe.java
@@ -1,7 +1,7 @@
 // Test next-over-NPE.
 /* This testcase is part of GDB, the GNU debugger.
 
-   Copyright 2009 Free Software Foundation, Inc.
+   Copyright 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-30 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-30 15:46 [SCM] archer-pmuldoon-next-over-throw2: test case updates as suggested by Jan tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).