public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/30094] New: [gdb/testsuite, ada] Introduce gnat_runtime_has_minimal_debug_info / gnat_runtime_has_full_debug_info
@ 2023-02-07 10:35 vries at gcc dot gnu.org
  2023-06-19  9:47 ` [Bug testsuite/30094] " cvs-commit at gcc dot gnu.org
  2023-06-19  9:48 ` vries at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2023-02-07 10:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30094

            Bug ID: 30094
           Summary: [gdb/testsuite, ada] Introduce
                    gnat_runtime_has_minimal_debug_info /
                    gnat_runtime_has_full_debug_info
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

I ran into:
...
(gdb) catch exception some_kind_of_error^M
Your Ada runtime appears to be missing some debugging information.^M
Cannot insert Ada exception catchpoint in this configuration.^M
(gdb) UNSUPPORTED: gdb.ada/catch_ex_std.exp: catch exception some_kind_of_error
...
and indeed, after installing the debug info package libada7-debuginfo, I got
instead:
...
PASS: gdb.ada/catch_ex_std.exp: compilation foo.adb
PASS: gdb.ada/catch_ex_std.exp: catch exception some_kind_of_error
PASS: gdb.ada/catch_ex_std.exp: caught the exception
PASS: gdb.ada/catch_ex_std.exp: print $_ada_exception =
some_package.some_kind_of_error'Address
...

Then I wondered if it would be possible to use gnat_runtime_has_debug_info in
this test-case, say using a require.  So I tried:
...
 require allow_ada_tests

+require gnat_runtime_has_debug_info
+
 standard_ada_testfile foo
...
and removed the debug info package, but I ran into the same UNSUPPORTED as
before, in other words, gnat_runtime_has_debug_info returned 1.

The reason is that gnat_runtime_has_debug_info tests for presence of a symbol
__gnat_debug_raise_exception, and while the debug info package is not
installed, the shared lib is not stripped and we find it here:
...
$ nm -D /usr/lib64/libgnat-7.so | grep __gnat_debug_raise_exception
000000000025ac7c T __gnat_debug_raise_exception
...

Interestingly, when looking at the "Your Ada runtime appears" error, it
triggers for the very same symbol, and it triggers because msym.minsym->type ()
!= mst_solib_trampoline, instead it has:
...
(gdb) p msym.minsym->type ()
$4 = mst_text
...

Concluding, there seem to be two levels of debug info support, minimal and
full, and the minimal one seems to be sufficient to allow
gdb.ada/ptype_tagged_param to pass, while the full one is required for
gdb.ada/catch_ex_std.exp.

It would be good if we had gnat_runtime_has_debug_info variants to distinguish
between these cases.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug testsuite/30094] [gdb/testsuite, ada] Introduce gnat_runtime_has_minimal_debug_info / gnat_runtime_has_full_debug_info
  2023-02-07 10:35 [Bug testsuite/30094] New: [gdb/testsuite, ada] Introduce gnat_runtime_has_minimal_debug_info / gnat_runtime_has_full_debug_info vries at gcc dot gnu.org
@ 2023-06-19  9:47 ` cvs-commit at gcc dot gnu.org
  2023-06-19  9:48 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-19  9:47 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30094

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=319626ca736d15836f5381bdc9f0e37396f61b15

commit 319626ca736d15836f5381bdc9f0e37396f61b15
Author: Tom de Vries <tdevries@suse.de>
Date:   Mon Jun 19 11:47:29 2023 +0200

    [gdb/testsuite] Add shared_gnat_runtime_has_debug_info

    Test-case gdb.ada/catch_ex_std.exp passes for me with package
    libada7-debuginfo installed, but after removing it I get:
    ...
    (gdb) catch exception some_kind_of_error^M
    Your Ada runtime appears to be missing some debugging information.^M
    Cannot insert Ada exception catchpoint in this configuration.^M
    (gdb) FAIL: gdb.ada/catch_ex_std.exp: catch exception some_kind_of_error
    ...

    The test-case contains a require gnat_runtime_has_debug_info to deal with
    this, but the problem is that this checks the static gnat runtime, while
this
    test-case uses the shared one.

    Fix this by introducing shared_gnat_runtime_has_debug_info, and requiring
that
    one instead.

    Tested on x86_64-linux.

    PR testsuite/30094
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30094

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug testsuite/30094] [gdb/testsuite, ada] Introduce gnat_runtime_has_minimal_debug_info / gnat_runtime_has_full_debug_info
  2023-02-07 10:35 [Bug testsuite/30094] New: [gdb/testsuite, ada] Introduce gnat_runtime_has_minimal_debug_info / gnat_runtime_has_full_debug_info vries at gcc dot gnu.org
  2023-06-19  9:47 ` [Bug testsuite/30094] " cvs-commit at gcc dot gnu.org
@ 2023-06-19  9:48 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2023-06-19  9:48 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30094

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.1
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-19  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 10:35 [Bug testsuite/30094] New: [gdb/testsuite, ada] Introduce gnat_runtime_has_minimal_debug_info / gnat_runtime_has_full_debug_info vries at gcc dot gnu.org
2023-06-19  9:47 ` [Bug testsuite/30094] " cvs-commit at gcc dot gnu.org
2023-06-19  9:48 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).