Bug 31290 - gdb.base/list-nodebug.exp failure
Summary: gdb.base/list-nodebug.exp failure
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: testsuite (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 15.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-24 16:17 UTC by Simon Marchi
Modified: 2024-03-17 15:48 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
tentative patch (1.40 KB, patch)
2024-03-17 09:17 UTC, Tom de Vries
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Marchi 2024-01-24 16:17:43 UTC
On Debian 12, I see:

(gdb) run 
Starting program: /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/list-nodebug/list-nodebug 
warning: amd-dbgapi: unable to enable GPU debugging due to a restriction error
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, 0x000055555555512d in main ()
(gdb) list .
No symbol table is loaded.  Use the "file" command.
(gdb) FAIL: gdb.base/list-nodebug.exp: first 'list .'
list .
No symbol table is loaded.  Use the "file" command.
(gdb) FAIL: gdb.base/list-nodebug.exp: second 'list .'
Comment 1 Tom de Vries 2024-03-16 23:06:10 UTC
My guess is that this can be fixed by using two source files, one with debug info and one without.
Comment 2 Tom de Vries 2024-03-17 09:17:41 UTC
Created attachment 15410 [details]
tentative patch
Comment 4 Sourceware Commits 2024-03-17 15:47:47 UTC
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

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

commit 42db3e48c5532a6a4aa3952e0a3d02f3dfac6f0a
Author: Tom de Vries <tdevries@suse.de>
Date:   Sun Mar 17 16:48:43 2024 +0100

    [gdb/testsuite] Fix gdb.base/list-no-debug.exp on debian
    
    On debian 12, aarch64-linux I run into:
    ...
    (gdb) list .^M
    No symbol table is loaded.  Use the "file" command.^M
    (gdb) FAIL: gdb.base/list-nodebug.exp: first 'list .'
    ...
    
    The test-case expects some debug info, but none for main.  Instead, there's no
    debug info at all.
    
    Fix this by adding another source file to the test-case, and compiling it with
    debug info.
    
    Tested on aarch64-linux.
    
    Approved-By: Andrew Burgess <aburgess@redhat.com>
    
    PR testsuite/31290
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31290
Comment 5 Tom de Vries 2024-03-17 15:48:12 UTC
Fixed.