public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: fix unresolved test in gdb-caching-proc-consistency.exp
@ 2024-05-27 21:26 Andrew Burgess
  2024-05-27 22:00 ` Tom de Vries
  2024-05-28 15:19 ` Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Burgess @ 2024-05-27 21:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

When running gdb.testsuite/gdb-caching-proc-consistency.exp with the
native-gdbserver board, I see an error reported:

  ERROR: gdbserver does not support attach 2036113 without extended-remote

and a test is reported UNRESOLVED:

   UNRESOLVED: gdb.testsuite/gdb-caching-proc-consistency.exp: testcase '<snip>/gdb.testsuite/gdb-caching-proc-consistency.exp' aborted due to Tcl error

The problem is that we are calling the can_spawn_for_attach_1 caching
proc directly, rather than through the can_spawn_for_attach wrapper
proc (which is not caching).

To fix this, in gdb-caching-proc-consistency.exp, I did consider
having 'test_file' spot 'can_spawn_for_attach_1' and test
'can_spawn_for_attach' instead, but that runs into problems as the
'test_proc' procedure does expect to be calling a caching proc, not a
non-caching wrapper proc.

I could make 'test_proc' smarter, but in the end I just opted to
replicate the condition checks from 'can_spawn_for_attach' inside the
'test_file' procedure, there's only two of them, this seems like the
easiest fix.

If we end up with more cases like this then it might be worth
restructuring things in here to better handle wrapper procs, but for
now that doesn't feel necessary.
---
 .../gdb.testsuite/gdb-caching-proc-consistency.exp        | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
index 572ffb526ba..5312b395283 100644
--- a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
+++ b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
@@ -91,6 +91,14 @@ proc test_file { file } {
 		"target_is_gdbserver" { set setup_gdb 1 }
 		"supports_memtag" { set setup_gdb 1 }
 		"have_native_target" { set setup_gdb 1 }
+		"can_spawn_for_attach_1" {
+		    # This replicates the checks found in
+		    # 'can_spawn_for_attach'.
+		    if {[is_remote target] \
+			    || [target_info exists use_gdb_stub]} {
+			continue
+		    }
+		}
 		default {set setup_gdb 0 }
 	    }
 

base-commit: bdc10cded85aa8995e80394099c9e542b6172979
-- 
2.25.4


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

* Re: [PATCH] gdb/testsuite: fix unresolved test in gdb-caching-proc-consistency.exp
  2024-05-27 21:26 [PATCH] gdb/testsuite: fix unresolved test in gdb-caching-proc-consistency.exp Andrew Burgess
@ 2024-05-27 22:00 ` Tom de Vries
  2024-06-03 18:19   ` Andrew Burgess
  2024-05-28 15:19 ` Tom Tromey
  1 sibling, 1 reply; 4+ messages in thread
From: Tom de Vries @ 2024-05-27 22:00 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches

On 5/27/24 23:26, Andrew Burgess wrote:
> When running gdb.testsuite/gdb-caching-proc-consistency.exp with the
> native-gdbserver board, I see an error reported:
> 
>    ERROR: gdbserver does not support attach 2036113 without extended-remote
> 
> and a test is reported UNRESOLVED:
> 
>     UNRESOLVED: gdb.testsuite/gdb-caching-proc-consistency.exp: testcase '<snip>/gdb.testsuite/gdb-caching-proc-consistency.exp' aborted due to Tcl error
> 

Hi Andrew,

can you double-check that you're still running into this problem?

My understanding is that this was fixed by commit 9839849c0c3 
("[gdb/testsuite] Fix can_spawn_for_attach_1 consistency check").

Thanks,
- Tom

> The problem is that we are calling the can_spawn_for_attach_1 caching
> proc directly, rather than through the can_spawn_for_attach wrapper
> proc (which is not caching).
> 
> To fix this, in gdb-caching-proc-consistency.exp, I did consider
> having 'test_file' spot 'can_spawn_for_attach_1' and test
> 'can_spawn_for_attach' instead, but that runs into problems as the
> 'test_proc' procedure does expect to be calling a caching proc, not a
> non-caching wrapper proc.
> 
> I could make 'test_proc' smarter, but in the end I just opted to
> replicate the condition checks from 'can_spawn_for_attach' inside the
> 'test_file' procedure, there's only two of them, this seems like the
> easiest fix.
> 
> If we end up with more cases like this then it might be worth
> restructuring things in here to better handle wrapper procs, but for
> now that doesn't feel necessary.
> ---
>   .../gdb.testsuite/gdb-caching-proc-consistency.exp        | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
> index 572ffb526ba..5312b395283 100644
> --- a/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
> +++ b/gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
> @@ -91,6 +91,14 @@ proc test_file { file } {
>   		"target_is_gdbserver" { set setup_gdb 1 }
>   		"supports_memtag" { set setup_gdb 1 }
>   		"have_native_target" { set setup_gdb 1 }
> +		"can_spawn_for_attach_1" {
> +		    # This replicates the checks found in
> +		    # 'can_spawn_for_attach'.
> +		    if {[is_remote target] \
> +			    || [target_info exists use_gdb_stub]} {
> +			continue
> +		    }
> +		}
>   		default {set setup_gdb 0 }
>   	    }
>   
> 
> base-commit: bdc10cded85aa8995e80394099c9e542b6172979


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

* Re: [PATCH] gdb/testsuite: fix unresolved test in gdb-caching-proc-consistency.exp
  2024-05-27 21:26 [PATCH] gdb/testsuite: fix unresolved test in gdb-caching-proc-consistency.exp Andrew Burgess
  2024-05-27 22:00 ` Tom de Vries
@ 2024-05-28 15:19 ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2024-05-28 15:19 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> +		    if {[is_remote target] \
Andrew> +			    || [target_info exists use_gdb_stub]} {
Andrew> +			continue

FWIW I don't think the backslash is needed there.

Tom

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

* Re: [PATCH] gdb/testsuite: fix unresolved test in gdb-caching-proc-consistency.exp
  2024-05-27 22:00 ` Tom de Vries
@ 2024-06-03 18:19   ` Andrew Burgess
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Burgess @ 2024-06-03 18:19 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

Tom de Vries <tdevries@suse.de> writes:

> On 5/27/24 23:26, Andrew Burgess wrote:
>> When running gdb.testsuite/gdb-caching-proc-consistency.exp with the
>> native-gdbserver board, I see an error reported:
>> 
>>    ERROR: gdbserver does not support attach 2036113 without extended-remote
>> 
>> and a test is reported UNRESOLVED:
>> 
>>     UNRESOLVED: gdb.testsuite/gdb-caching-proc-consistency.exp: testcase '<snip>/gdb.testsuite/gdb-caching-proc-consistency.exp' aborted due to Tcl error
>> 
>
> Hi Andrew,
>
> can you double-check that you're still running into this problem?
>
> My understanding is that this was fixed by commit 9839849c0c3 
> ("[gdb/testsuite] Fix can_spawn_for_attach_1 consistency check").

You're absolutely correct.  I didn't spot your fix when I rebased my
patch.  Consider this patch withdrawn.  Sorry for the noise.

I have just posted this:

  https://inbox.sourceware.org/gdb-patches/cover.1717438458.git.aburgess@redhat.com

which also relates to the caching proc mechanism.

Thanks,
Andrew


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

end of thread, other threads:[~2024-06-03 18:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27 21:26 [PATCH] gdb/testsuite: fix unresolved test in gdb-caching-proc-consistency.exp Andrew Burgess
2024-05-27 22:00 ` Tom de Vries
2024-06-03 18:19   ` Andrew Burgess
2024-05-28 15:19 ` Tom Tromey

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).