From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/testsuite: fix failure in gdb.server/fetch-exec-and-args.exp
Date: Thu, 22 Jan 2026 15:31:50 +0000 [thread overview]
Message-ID: <87ms25hdeh.fsf@redhat.com> (raw)
In-Reply-To: <f059e227-7d65-4302-8488-4b4a60e666c7@simark.ca>
Simon Marchi <simark@simark.ca> writes:
> On 1/14/26 3:01 PM, Andrew Burgess wrote:
>> Bug PR gdb/33792 reported a gdb.server/fetch-exec-and-args.exp FAIL
>> when using the native-gdbserver board:
>>
>> FAIL: gdb.server/fetch-exec-and-args.exp: packet=on: set_remote_exec=false: test_server_with_no_exec: show remote exec-file
>>
>> The actual test output looks like this:
>>
>> (gdb) show remote exec-file
>> The remote exec-file is unset, using automatic value "/tmp/build/gdb/testsuite/outputs/gdb.server/fetch-exec-and-args/fetch-exec-and-args".
>> (gdb) FAIL: gdb.server/fetch-exec-and-args.exp: packet=on: set_remote_exec=false: test_server_with_no_exec: show remote exec-file
>>
>> This test actually fails with native-gdbsever and
>> native-extended-gdbserver boards. The problem is that these boards
>> clear the sysroot.
>>
>> This exact test has the following conditions:
>>
>> + The qExecAndArgs is in use (see 'packet=on').
>>
>> + We're not explicitly doing 'set remote exec-file ...' (see
>> 'set_remote_exec=false').
>>
>> + The test starts gdbserver without an executable (see
>> 'test_server_with_no_exec').
>>
>> + And because of the native-gdbsever board, the sysroot is "".
>>
>> What this means is that GDB knows that gdbserver doesn't have an
>> executable thanks to qExecAndArgs, the user hasn't set an executable
>> for GDB to use when starting a new inferior, but GDB does know that
>> GDB and gdbserver can see the same filesystem due to the sysroot
>> setting. GDB will then automatically use the current executable as
>> the remote executable name. The test script doesn't expect this case,
>> and so the test fails.
>>
>> Fix this by adjusting the script to expect the 'using automatic value
>> ...' text when appropriate.
>>
>> I also extended the test_server_with_no_exec proc to take a new flag
>> 'clear_sysroot', we now run the test with the sysroot set to 'target:'
>> and with the sysroot set to "", even when using the 'unix' board.
>>
>> Additionally, I ran the test through check-all-boards and found one
>> additional failure, when using --host_board=local-remote-host-native
>> and --target_board=local-remote-host-native. In this case GDB copies
>> the executable to the remote host, which changes its filename. When
>> the filename appears in the 'using automatic value ...' text, I was
>> expecting the filename assuming a local host.
>>
>> I could fix this, but it doesn't seem worth the extra complexity for
>> this one test, so I've just set the test to be skipped for that one
>> configuration.
>>
>> Now, when using check-all-boards, I'm seeing no failures.
>>
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33792
>
> It appears to fix the failure on my side. Thanks for the quick fix and
> for improving the test.
>
> Approved-By: Simon Marchi <simon.marchi@efficios.com>
I forgot about this one. Now pushed.
Thanks,
Andrew
next prev parent reply other threads:[~2026-01-22 15:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 15:07 [PATCH] gdb: use current executable for 'remote exec-file' in some cases Andrew Burgess
2025-10-06 15:43 ` Eli Zaretskii
2025-10-09 16:17 ` Simon Marchi
2025-10-11 13:34 ` [PATCH 0/2] Auto setting of 'remote exec-file' Andrew Burgess
2025-10-11 13:34 ` [PATCH 1/2] gdb/remote: replace use of std::pair with an actual struct Andrew Burgess
2025-10-11 13:46 ` Simon Marchi
2025-10-12 8:57 ` Andrew Burgess
2025-10-12 12:05 ` Simon Marchi
2025-10-12 13:13 ` Andrew Burgess
2025-11-19 10:32 ` Andrew Burgess
2025-10-11 13:34 ` [PATCH 2/2] gdb: use current executable for 'remote exec-file' in some cases Andrew Burgess
2025-10-11 14:45 ` Eli Zaretskii
2025-11-07 20:46 ` Simon Marchi
2025-11-11 15:59 ` Andrew Burgess
2026-01-14 1:17 ` Simon Marchi
2026-01-14 16:48 ` Andrew Burgess
2026-01-14 20:01 ` [PATCH] gdb/testsuite: fix failure in gdb.server/fetch-exec-and-args.exp Andrew Burgess
2026-01-15 21:13 ` Simon Marchi
2026-01-22 15:31 ` Andrew Burgess [this message]
2025-11-19 10:32 ` [PATCH 2/2] gdb: use current executable for 'remote exec-file' in some cases Andrew Burgess
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=87ms25hdeh.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/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