[gdb/testsuite] Fix gdb.base/list-no-debug.exp on debian
commit42db3e48c5532a6a4aa3952e0a3d02f3dfac6f0a
authorTom de Vries <tdevries@suse.de>
Sun, 17 Mar 2024 15:48:43 +0000 (17 16:48 +0100)
committerTom de Vries <tdevries@suse.de>
Sun, 17 Mar 2024 15:48:43 +0000 (17 16:48 +0100)
treec2002d13100e2ce35efb58ee7866f13c4321dd51
parent04d7f8a5bc3a2b4be65583b10ef100bc567faca1
[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
gdb/testsuite/gdb.base/list-nodebug-2.c [copied from gdb/testsuite/gdb.base/list-nodebug.c with 93% similarity]
gdb/testsuite/gdb.base/list-nodebug.c
gdb/testsuite/gdb.base/list-nodebug.exp