From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/Ada(v2) 1/3] Add command to list Ada exceptions
Date: Fri, 15 Nov 2013 07:28:00 -0000 [thread overview]
Message-ID: <20131115063915.GU3481@adacore.com> (raw)
In-Reply-To: <20131113172135.GL3481@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]
> > The new test fails for me like this:
> >
> > (gdb) info exceptions
> > All defined Ada exceptions:
> > const.aint_global_e: 0x608120
> > (gdb) FAIL: gdb.ada/info_exc.exp: info exceptions
> >
> > The test case expects there to be more exceptions:
> >
> > gdb_test "info exceptions" \
> > [multi_line "All defined Ada exceptions:" \
> > "constraint_error: $hex" \
> > "program_error: $hex" \
> > "storage_error: $hex" \
> > "tasking_error: $hex" \
> > "const.aint_global_e: $hex"]
> >
> > Any ideas why this may happen?
I think I have an idea, now. It is similar to what we need to do
in the "catch exception" testcases, where we start the program
in order to be certain that we can find the symbols from the GNAT
runtime. On Fedora, and I suspect may other distros, the default
for gnatmake is to like against the shared libgnat, whereas the
gnatmake I use links against the static libgnat - this is why
I didn't see that omission. Can you try the attached?
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.
Tested on x86_64-linux.
--
Joel
[-- Attachment #2: 0001-Start-inferior-before-running-test-listing-Ada-excep.patch --]
[-- Type: text/x-diff, Size: 1977 bytes --]
From d0aa384d0eb08c4bf855a967af49ec15bb513d97 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
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
next prev parent reply other threads:[~2013-11-15 6:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-08 12:04 RFA/Ada (v2) new CLI + GDB/MI commands " Joel Brobecker
2013-11-08 12:04 ` [RFA/Ada(v2) 3/3] Document "info exceptions" and "-info-ada-exception" new commands Joel Brobecker
2013-11-08 14:21 ` Eli Zaretskii
2013-11-10 9:49 ` Joel Brobecker
2013-11-12 4:07 ` Joel Brobecker
2013-11-08 12:05 ` [RFA/Ada(v2) 1/3] Add command to list Ada exceptions Joel Brobecker
2013-11-08 13:40 ` Pedro Alves
2013-11-08 14:10 ` Joel Brobecker
2013-11-08 15:47 ` Tom Tromey
2013-11-08 16:13 ` Joel Brobecker
2013-11-08 16:32 ` Tom Tromey
2013-11-10 6:29 ` Joel Brobecker
2013-11-11 14:48 ` Tom Tromey
2013-11-13 17:04 ` Tom Tromey
2013-11-13 18:29 ` Joel Brobecker
2013-11-15 7:28 ` Joel Brobecker [this message]
2013-11-15 15:53 ` Tom Tromey
2013-11-15 17:06 ` Joel Brobecker
2013-11-15 17:48 ` Tom Tromey
2013-11-15 18:01 ` Joel Brobecker
2013-11-15 18:23 ` Tom Tromey
2013-11-16 3:51 ` pushed: " Joel Brobecker
2013-11-08 12:27 ` [RFA/Ada(v2) 2/3] Implement GDB/MI equivalent of "info exceptions" CLI command Joel Brobecker
2013-11-12 3:38 ` RFA/Ada (v2) new CLI + GDB/MI commands to list Ada exceptions Joel Brobecker
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=20131115063915.GU3481@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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