From d0aa384d0eb08c4bf855a967af49ec15bb513d97 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 15 Nov 2013 10:30:00 +0400 Subject: [PATCH] Start inferior before running test listing Ada exceptions. 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/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/gdb.ada/info_exc.exp | 5 +++++ gdb/testsuite/gdb.ada/mi_exc_info.exp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp index 3ff5180..9637bce 100644 --- a/gdb/testsuite/gdb.ada/info_exc.exp +++ b/gdb/testsuite/gdb.ada/info_exc.exp @@ -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" \ diff --git a/gdb/testsuite/gdb.ada/mi_exc_info.exp b/gdb/testsuite/gdb.ada/mi_exc_info.exp index b77ccbc..8325e90 100644 --- a/gdb/testsuite/gdb.ada/mi_exc_info.exp +++ b/gdb/testsuite/gdb.ada/mi_exc_info.exp @@ -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} -- 1.8.1.2