Start inferior before running test listing Ada exceptions.
authorJoel Brobecker <brobecker@adacore.com>
Fri, 15 Nov 2013 06:30:00 +0000 (10:30 +0400)
committerJoel Brobecker <brobecker@adacore.com>
Fri, 15 Nov 2013 16:14:25 +0000 (20:14 +0400)
This patch fixes some spurious failures when the inferior is linked
against the shared version of libgnat by default, as appears to be
the case on many GNU/Linux distributions.  When that happens, we have
to start the program in order to ensure that the GNAT runtime is
mapped to memory, in order for us to find the standard exceptions
(defined within the runtime).  Otherwise, they will not be shown,
as expected, by the debugger.

gdb/testsuite/ChangeLog:

        * gdb.ada/info_exc.exp: Start inferior before starting
        the "info exceptions" tests.
        * gdb.ada/mi_exc_info.exp: Start inferior before starting
        the "-info-ada-exceptions" tests.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/info_exc.exp
gdb/testsuite/gdb.ada/mi_exc_info.exp

index e3ed8788a25944092cc6fca8199990b577a108ca..0031289bf53adf150c918b229824077b79749df1 100644 (file)
@@ -1,3 +1,10 @@
+2013-11-15  Joel Brobecker  <brobecker@adacore.com>
+
+       * gdb.ada/info_exc.exp: Start inferior before starting
+       the "info exceptions" tests.
+       * gdb.ada/mi_exc_info.exp: Start inferior before starting
+       the "-info-ada-exceptions" tests.
+
 2013-11-15  Tom Tromey  <tromey@redhat.com>
 
        * gdb.cp/includefile: New file.
index 3ff51802c48f5cfb74dde278650321257d3d0ce7..9637bce3a2ebe0aa93d8487993d5a80c2053b30b 100644 (file)
@@ -34,6 +34,11 @@ proc multi_line { args } {
 
 clean_restart ${testfile}
 
+if ![runto_main] then {
+   fail "Cannot run to main, testcase aborted"
+   return 0
+}
+
 gdb_test "info exceptions" \
     [multi_line "All defined Ada exceptions:" \
                 "constraint_error: $hex" \
index b77ccbcf9b6cd99327d325b43ca1305a048a51bb..8325e9051fcd8fa7bdc26c4a13d94312cf415429 100644 (file)
@@ -29,6 +29,11 @@ if [mi_gdb_start] {
     continue
 }
 
+if ![mi_run_to_main] then {
+   fail "Cannot run to main, testcase aborted"
+   return 0
+}
+
 mi_delete_breakpoints
 mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
This page took 0.038673 seconds and 4 git commands to generate.