Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
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 17:06:00 -0000	[thread overview]
Message-ID: <20131115164533.GX3481@adacore.com> (raw)
In-Reply-To: <877gc9vfyv.fsf@fleche.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1512 bytes --]

> 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

[-- Attachment #2: 0001-gdb.ada-info_exc.exp-mi_exc_info.exp-handle-runtimes.patch --]
[-- Type: text/x-diff, Size: 2848 bytes --]

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


  reply	other threads:[~2013-11-15 16:45 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
2013-11-15 15:53         ` Tom Tromey
2013-11-15 17:06           ` Joel Brobecker [this message]
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=20131115164533.GX3481@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