* [PATCH] [gdb/testsuite] Fix can_spawn_for_attach_1 consistency check
@ 2024-05-17 9:53 Tom de Vries
2024-05-20 13:47 ` Alexandra Petlanova Hajkova
0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2024-05-17 9:53 UTC (permalink / raw)
To: gdb-patches
When running test-case gdb.testsuite/gdb-caching-proc-consistency.exp with
target board native-gdbserver, we run into:
...
(gdb) ERROR: tcl error sourcing gdb.testsuite/gdb-caching-proc-consistency.exp.
ERROR: gdbserver does not support attach 4827 without extended-remote
while executing
"error "gdbserver does not support $command without extended-remote""
(procedure "gdb_test_multiple" line 51)
invoked from within
"gdb_test_multiple "attach $test_pid" "can spawn for attach" {
-re -wrap "$attaching_re\r\n.*ptrace: Operation not permitted\\." {
# Not permitte..."
(procedure "gdb_real__can_spawn_for_attach_1" line 27)
invoked from within
"gdb_real__can_spawn_for_attach_1"
...
The problem is that:
- can_spawn_for_attach_1 is a helper function for can_spawn_for_attach,
designed to be called only from that function, and
- can_spawn_for_attach_1 is a gdb_caching_proc, and consequently
test-case gdb.testsuite/gdb-caching-proc-consistency.exp calls
can_spawn_for_attach_1 directly.
Fix this by copying the early-outs from can_spawn_for_attach to
can_spawn_for_attach_1.
Tested on x86_64-linux.
Reported-By: Simon Marchi <simark@simark.ca>
---
gdb/testsuite/lib/gdb.exp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index aea0ba599c7..55f6ab1fd8b 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -6191,6 +6191,13 @@ proc gdb_exit { } {
# return 0 only if we cannot attach because it's unsupported.
gdb_caching_proc can_spawn_for_attach_1 {} {
+ # For the benefit of gdb-caching-proc-consistency.exp, which
+ # calls can_spawn_for_attach_1 directly. Keep in sync with
+ # can_spawn_for_attach.
+ if { [is_remote target] || [target_info exists use_gdb_stub] } {
+ return 0
+ }
+
# Assume yes.
set res 1
base-commit: 44fc9616c2e74396395f60c9a601317e4c4c4733
--
2.35.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [gdb/testsuite] Fix can_spawn_for_attach_1 consistency check
2024-05-17 9:53 [PATCH] [gdb/testsuite] Fix can_spawn_for_attach_1 consistency check Tom de Vries
@ 2024-05-20 13:47 ` Alexandra Petlanova Hajkova
2024-05-20 14:42 ` Tom de Vries
0 siblings, 1 reply; 3+ messages in thread
From: Alexandra Petlanova Hajkova @ 2024-05-20 13:47 UTC (permalink / raw)
To: Tom de Vries; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
>
> gdb_caching_proc can_spawn_for_attach_1 {} {
> + # For the benefit of gdb-caching-proc-consistency.exp, which
> + # calls can_spawn_for_attach_1 directly. Keep in sync with
> + # can_spawn_for_attach.
> + if { [is_remote target] || [target_info exists use_gdb_stub] } {
> + return 0
> + }
> +
> # Assume yes.
> set res 1
>
>
> This solution looks reasonable to me. Also I've tried running this test on
aarch64 but it always passes there:
make check RUNTESTFLAGS="--target_board=native-gdbserver"
TESTS=gdb.testsuite/gdb-caching-proc-consistency.exp
Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [gdb/testsuite] Fix can_spawn_for_attach_1 consistency check
2024-05-20 13:47 ` Alexandra Petlanova Hajkova
@ 2024-05-20 14:42 ` Tom de Vries
0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2024-05-20 14:42 UTC (permalink / raw)
To: Alexandra Petlanova Hajkova; +Cc: gdb-patches
On 5/20/24 15:47, Alexandra Petlanova Hajkova wrote:
> Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com
Hi Alexandra,
thanks for the review, pushed.
Thanks,
- Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-20 14:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-17 9:53 [PATCH] [gdb/testsuite] Fix can_spawn_for_attach_1 consistency check Tom de Vries
2024-05-20 13:47 ` Alexandra Petlanova Hajkova
2024-05-20 14:42 ` Tom de Vries
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).