public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/31647] New: [gdb/testsuite, old dejagnu] ERROR: invalid command name "gdb_find_gnatmake"
@ 2024-04-17 10:52 vries at gcc dot gnu.org
  2024-04-18 10:26 ` [Bug testsuite/31647] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2024-04-17 10:52 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31647
           Summary: [gdb/testsuite, old dejagnu] ERROR: invalid command
                    name "gdb_find_gnatmake"
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On SLE-11, with a gdb-13.2-based package, I ran into:
...
Running /usr/src/packages/BUILD/gdb-13.2/gdb/testsuite/gdb.ada/mi_prot.exp ...
UNRESOLVED: gdb.ada/mi_prot.exp: testcase aborted due to invalid command name:
gdb_find_gnatmake
ERROR: tcl error sourcing
/usr/src/packages/BUILD/gdb-13.2/gdb/testsuite/gdb.ada/mi_prot.exp.
ERROR: invalid command name "gdb_find_gnatmake"
    while executing
"::gdb_tcl_unknown gdb_find_gnatmake"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 ::gdb_tcl_unknown $args"
    (procedure "::unknown" line 5)
    invoked from within
"gdb_find_gnatmake"
    (procedure "gnatmake_version_at_least" line 2)
    invoked from within
"gnatmake_version_at_least 8"
    invoked from within
"if { ![gnatmake_version_at_least 8] } {
    return -1
}"
...

The problem is that gdb_find_gnatmake is a backup for find_gnatmake:
...
if {[info procs find_gnatmake] == ""} {
    rename gdb_find_gnatmake find_gnatmake
    set use_gdb_compile(ada) 1
    gdb_note [join [list $note_prefix "Ada" $note_suffix] ""]
}
...
so gnatmake_version_at_least should use find_gnatmake instead.

We normally don't run into this because dejagnu is recent enough to include a
find_gnatmake, so gdb_find_gnatmake is kept.

With SLE-11, an old dejagnu is used, find_gnatmake is not found so
gdb_find_gnatmake is renamed to find_gnatmake, and we run into the error.

It's confusing that we're using the gdb_ prefix here, it seems something
legitimate to use.

Maybe we should use future_ or gdb_future_ prefix instead to make this more
clear.

Also, we could do:
...
 if {[info procs find_gnatmake] == ""} {
     rename gdb_find_gnatmake find_gnatmake
     set use_gdb_compile(ada) 1
     gdb_note [join [list $note_prefix "Ada" $note_suffix] ""]
 } else {
     rename gdb_find_gnatmake ""
 }
...
to prevent it being used by accident with a newer dejagnu.

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

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

* [Bug testsuite/31647] [gdb/testsuite, old dejagnu] ERROR: invalid command name "gdb_find_gnatmake"
  2024-04-17 10:52 [Bug testsuite/31647] New: [gdb/testsuite, old dejagnu] ERROR: invalid command name "gdb_find_gnatmake" vries at gcc dot gnu.org
@ 2024-04-18 10:26 ` vries at gcc dot gnu.org
  2024-04-18 15:01 ` cvs-commit at gcc dot gnu.org
  2024-04-18 15:02 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2024-04-18 10:26 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2024-April/208256.html

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

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

* [Bug testsuite/31647] [gdb/testsuite, old dejagnu] ERROR: invalid command name "gdb_find_gnatmake"
  2024-04-17 10:52 [Bug testsuite/31647] New: [gdb/testsuite, old dejagnu] ERROR: invalid command name "gdb_find_gnatmake" vries at gcc dot gnu.org
  2024-04-18 10:26 ` [Bug testsuite/31647] " vries at gcc dot gnu.org
@ 2024-04-18 15:01 ` cvs-commit at gcc dot gnu.org
  2024-04-18 15:02 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-18 15:01 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Sourceware Commits <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=4c8fc167568d60a44f5a1f98bcb788a65af7a7ae

commit 4c8fc167568d60a44f5a1f98bcb788a65af7a7ae
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Apr 18 17:02:13 2024 +0200

    [gdb/testsuite] Use find_gnatmake instead of gdb_find_gnatmake

    On SLE-11, with an older dejagnu version, I ran into:
    ...
    Running gdb.ada/mi_prot.exp ...
    UNRESOLVED: gdb.ada/mi_prot.exp: \
      testcase aborted due to invalid command name: gdb_find_gnatmake
    ERROR: tcl error sourcing gdb.ada/mi_prot.exp.
    ERROR: invalid command name "gdb_find_gnatmake"
        while executing
    "::gdb_tcl_unknown gdb_find_gnatmake"
        ("uplevel" body line 1)
        invoked from within
    "uplevel 1 ::gdb_tcl_unknown $args"
        (procedure "::unknown" line 5)
        invoked from within
    "gdb_find_gnatmake"
        (procedure "gnatmake_version_at_least" line 2)
        invoked from within
    ...

    Proc gdb_find_gnatmake is actually a backup for find_gnatmake:
    ...
    if {[info procs find_gnatmake] == ""} {
        rename gdb_find_gnatmake find_gnatmake
    ...
    so gnatmake_version_at_least should use find_gnatmake instead.

    For a recent dejagnu with find_gnatmake, gdb_find_gnatmake is kept, and we
    don't run into this error.

    For an older dejagnu without find_gnatmake, gdb_find_gnatmake is renamed to
    find_gnatmake, and we do run into the error.

    It's confusing that we're using the gdb_ prefix for gdb_find_gnatmake, it
    seems something legitimate to use.  Maybe we should use future_ or
gdb_future_
    prefix instead to make this more clear, but I've left that alone for now.

    Fix this by:
    - triggering the same error with a recent dejagnu by removing
      gdb_find_gnatmake unless used (and likewise for other procs in
future.exp),
      and
    - using find_gnatmake in gnatmake_version_at_least.

    Tested on x86_64-linux.

    Approved-By: Tom Tromey <tom@tromey.com>

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

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

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

* [Bug testsuite/31647] [gdb/testsuite, old dejagnu] ERROR: invalid command name "gdb_find_gnatmake"
  2024-04-17 10:52 [Bug testsuite/31647] New: [gdb/testsuite, old dejagnu] ERROR: invalid command name "gdb_find_gnatmake" vries at gcc dot gnu.org
  2024-04-18 10:26 ` [Bug testsuite/31647] " vries at gcc dot gnu.org
  2024-04-18 15:01 ` cvs-commit at gcc dot gnu.org
@ 2024-04-18 15:02 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2024-04-18 15:02 UTC (permalink / raw)
  To: gdb-prs

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

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

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

--- Comment #3 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] 4+ messages in thread

end of thread, other threads:[~2024-04-18 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 10:52 [Bug testsuite/31647] New: [gdb/testsuite, old dejagnu] ERROR: invalid command name "gdb_find_gnatmake" vries at gcc dot gnu.org
2024-04-18 10:26 ` [Bug testsuite/31647] " vries at gcc dot gnu.org
2024-04-18 15:01 ` cvs-commit at gcc dot gnu.org
2024-04-18 15:02 ` 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).