[3/4] Fix detach.exp remote check

Message ID 1459912543-15328-3-git-send-email-simon.marchi@polymtl.ca
State Accepted, archived
Headers

Commit Message

Simon Marchi April 6, 2016, 3:15 a.m. UTC
  This test seems to work with both native-gdbserver and
native-extended-gdbserver, so I removed the remote check.

When running with native-gdbserver (a stub-like target), detach makes
gdbserver stop and gdb disconnect.  runto_main just spawns a brand new
gdbserver.  So it tests the exact same thing twice.  It doesn't hurt
though.

With native-extended-gdbserver, the test is probably a bit more useful
(and similar to native).  It tests running/detaching twice using the
same gdb/gdbserver instances, since with extended-remote, you can
detach/attach/run all you want, unlike with remote.

gdb/testsuite/ChangeLog:

	* gdb.base/detach.exp: Remove is_remote check.
---
 gdb/testsuite/gdb.base/detach.exp | 5 -----
 1 file changed, 5 deletions(-)
  

Comments

Pedro Alves April 11, 2016, 6:16 p.m. UTC | #1
On 04/06/2016 04:15 AM, Simon Marchi wrote:
> This test seems to work with both native-gdbserver and
> native-extended-gdbserver, so I removed the remote check.
> 
> When running with native-gdbserver (a stub-like target), detach makes
> gdbserver stop and gdb disconnect.  runto_main just spawns a brand new
> gdbserver.  So it tests the exact same thing twice.  It doesn't hurt
> though.

It's not exactly the same thing, as the second test runs with the same
gdb, so it exercises "run" or "target connect" after a previous
"detach", which can expose problems with stale state from the previous
connection.  So also useful.

> gdb/testsuite/ChangeLog:
> 
> 	* gdb.base/detach.exp: Remove is_remote check.

OK.

Thanks,
Pedro Alves
  
Simon Marchi May 2, 2016, 5:11 p.m. UTC | #2
On 2016-04-11 14:16, Pedro Alves wrote:
> On 04/06/2016 04:15 AM, Simon Marchi wrote:
>> This test seems to work with both native-gdbserver and
>> native-extended-gdbserver, so I removed the remote check.
>> 
>> When running with native-gdbserver (a stub-like target), detach makes
>> gdbserver stop and gdb disconnect.  runto_main just spawns a brand new
>> gdbserver.  So it tests the exact same thing twice.  It doesn't hurt
>> though.
> 
> It's not exactly the same thing, as the second test runs with the same
> gdb, so it exercises "run" or "target connect" after a previous
> "detach", which can expose problems with stale state from the previous
> connection.  So also useful.

True.

>> gdb/testsuite/ChangeLog:
>> 
>> 	* gdb.base/detach.exp: Remove is_remote check.
> 
> OK.

I pushed this one as well, thanks.
  

Patch

diff --git a/gdb/testsuite/gdb.base/detach.exp b/gdb/testsuite/gdb.base/detach.exp
index 920dac2..b9343ee 100644
--- a/gdb/testsuite/gdb.base/detach.exp
+++ b/gdb/testsuite/gdb.base/detach.exp
@@ -22,11 +22,6 @@  if { ! [istarget "*-*-linux*"] } {
   return 0
 }
 
-# Are we on a target board?
-if [is_remote target] then {
-    return 0
-}
-
 standard_testfile attach.c
 set escapedbinfile  [string_to_regexp ${binfile}]