This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/Ada(v2) 1/3] Add command to list Ada exceptions
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 15 Nov 2013 20:45:33 +0400
- Subject: Re: [RFA/Ada(v2) 1/3] Add command to list Ada exceptions
- Authentication-results: sourceware.org; auth=none
- References: <1383912219-13012-1-git-send-email-brobecker at adacore dot com> <1383912219-13012-2-git-send-email-brobecker at adacore dot com> <87r4akz2n6 dot fsf at fleche dot redhat dot com> <20131113172135 dot GL3481 at adacore dot com> <20131115063915 dot GU3481 at adacore dot com> <877gc9vfyv dot fsf at fleche dot redhat dot com>
> Joel> * gdb.ada/info_exc.exp: Start inferior before starting
> Joel> the "info exceptions" tests.
> Joel> * gdb.ada/mi_exc_info.exp: Start inferior before starting
> Joel> the "-info-ada-exceptions" tests.
>
> Thanks Joel. This still fails, but in a new way, see appended.
Humpf :-(. At least that's progress.
This one is pretty easy to understand: Because you have debugging
info for *all* runtime units, "info exceptions" gets to list them
as well. The output you're getting is legit, so we have to accept it.
That's a bit unfortunate, as this forces us to introduce wildcards
in the expected output. Oh well...
I've pushed the patch you tested, and then pushed also the attached
patch.
gdb/testsuite/ChangeLog:
* gdb.ada/info_exc.exp: Allow other global exceptions to be
listed in the output of "info exceptions".
* gdb.ada/mi_exc_info.exp: Allow other global exceptions to be
listed in the output of "-info-ada-exceptions".
I did not test it on Fedora, since I haven't installed much on
the VM I just created. But I tested on my x86_64-linux laptop,
by reproducing another form of the same problem, involving the
use of "gnatmake -f -a -g" instead of plain "gnatmake -g" to build
the program. The added options force the GNAT runtime to be recompiled,
thus putting me in the same situation as you. The testsuite passes
for me in both situations (no debug info, with debug info).
Hopefully that'll solve your issue as well.
--
Joel
>From 2d4bfc30088a64073d5c73d3b1afa7601a826763 Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Fri, 15 Nov 2013 20:34:09 +0400
Subject: [PATCH] gdb.ada/info_exc.exp,mi_exc_info.exp: handle runtimes with
full debug info.
If the runtime has full debug info, then the non-standard exceptions
declared in the GNAT runtime will appear in the list of exceptions
printed by GDB ("info exceptions" or "-info-ada-exceptions").
This is valid output, so this patch allows for it.
gdb/testsuite/ChangeLog:
* gdb.ada/info_exc.exp: Allow other global exceptions to be
listed in the output of "info exceptions".
* gdb.ada/mi_exc_info.exp: Allow other global exceptions to be
listed in the output of "-info-ada-exceptions".
---
gdb/testsuite/gdb.ada/info_exc.exp | 4 +++-
gdb/testsuite/gdb.ada/mi_exc_info.exp | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp
index 9637bce..9210029 100644
--- a/gdb/testsuite/gdb.ada/info_exc.exp
+++ b/gdb/testsuite/gdb.ada/info_exc.exp
@@ -45,7 +45,9 @@ gdb_test "info exceptions" \
"program_error: $hex" \
"storage_error: $hex" \
"tasking_error: $hex" \
- "const.aint_global_e: $hex"]
+ ".*" \
+ "const.aint_global_e: $hex" \
+ ".*"]
gdb_test "info exceptions task" \
[multi_line "All Ada exceptions matching regular expression \"task\":" \
diff --git a/gdb/testsuite/gdb.ada/mi_exc_info.exp b/gdb/testsuite/gdb.ada/mi_exc_info.exp
index 8325e90..14a9e4d 100644
--- a/gdb/testsuite/gdb.ada/mi_exc_info.exp
+++ b/gdb/testsuite/gdb.ada/mi_exc_info.exp
@@ -39,7 +39,7 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
mi_gdb_test "-info-ada-exceptions" \
- "\\^done,ada-exceptions={nr_rows=\"5\",nr_cols=\"2\",hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"name\",colhdr=\"Name\"},{width=\"1\",alignment=\"-1\",col_name=\"address\",colhdr=\"Address\"}\\\],body=\\\[{name=\"constraint_error\",address=\"$hex\"},{name=\"program_error\",address=\"$hex\"},{name=\"storage_error\",address=\"$hex\"},{name=\"tasking_error\",address=\"$hex\"},{name=\"const.aint_global_e\",address=\"$hex\"}\\\]}" \
+ "\\^done,ada-exceptions={nr_rows=\"$decimal\",nr_cols=\"2\",hdr=\\\[{width=\"1\",alignment=\"-1\",col_name=\"name\",colhdr=\"Name\"},{width=\"1\",alignment=\"-1\",col_name=\"address\",colhdr=\"Address\"}\\\],body=\\\[{name=\"constraint_error\",address=\"$hex\"},{name=\"program_error\",address=\"$hex\"},{name=\"storage_error\",address=\"$hex\"},{name=\"tasking_error\",address=\"$hex\"},.*{name=\"const.aint_global_e\",address=\"$hex\"}.*\\\]}" \
"-info-ada-exceptions"
mi_gdb_test "-info-ada-exceptions task" \
--
1.8.1.2