[OB,gdb/testsuite] Handle removed valgrind option --db-attach

Message ID 20181024111355.GA13788@delia
State New, archived
Headers

Commit Message

Tom de Vries Oct. 24, 2018, 11:13 a.m. UTC
  Hi,

When running valgrind-db-attach.exp with valgrind version 3.13.0, we get:
...
PASS: gdb.base/valgrind-db-attach.exp: spawn valgrind
valgrind: Unknown option: --db-attach=yes
valgrind: Use --help for more information or consult the user manual.
ERROR: Process no longer exists
UNRESOLVED: gdb.base/valgrind-db-attach.exp: valgrind started
...

The valgrind option --db-attach has been deprecated in version 3.10.0, and
removed in version 3.11.0.

Fix valgrind-db-attach.exp to replace the ERROR/UNRESOLVED with:
...
UNSUPPORTED: gdb.base/valgrind-db-attach.exp: valgrind started
...

Tested on x86_64-linux.

Committed as obvious.

Thanks,
- Tom

[gdb/testsuite] Handle removed valgrind option --db-attach

2018-10-24  Tom de Vries  <tdevries@suse.de>

	* gdb.base/valgrind-db-attach.exp: Handle removed support for
	--db-attach in valgrind.

---
 gdb/testsuite/gdb.base/valgrind-db-attach.exp | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Pedro Alves Oct. 24, 2018, 4:29 p.m. UTC | #1
On 10/24/2018 12:13 PM, Tom de Vries wrote:
> Hi,
> 
> When running valgrind-db-attach.exp with valgrind version 3.13.0, we get:
> ...
> PASS: gdb.base/valgrind-db-attach.exp: spawn valgrind
> valgrind: Unknown option: --db-attach=yes
> valgrind: Use --help for more information or consult the user manual.
> ERROR: Process no longer exists
> UNRESOLVED: gdb.base/valgrind-db-attach.exp: valgrind started
> ...
> 
> The valgrind option --db-attach has been deprecated in version 3.10.0, and
> removed in version 3.11.0.
> 

But was it replaced with / renamed to something else equivalent,
or the functionality completely eliminated?

If the latter, I don't see much value in keeping the
test case around going forward.  Especially if we have no
comment in the source indicating when it stopped being useful...
It ends up just being dead weight and future gdb developers
won't even realize.

Thanks,
Pedro Alves

> Fix valgrind-db-attach.exp to replace the ERROR/UNRESOLVED with:
> ...
> UNSUPPORTED: gdb.base/valgrind-db-attach.exp: valgrind started
> ...
> 
> Tested on x86_64-linux.
> 
> Committed as obvious.
> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Handle removed valgrind option --db-attach
> 
> 2018-10-24  Tom de Vries  <tdevries@suse.de>
> 
> 	* gdb.base/valgrind-db-attach.exp: Handle removed support for
> 	--db-attach in valgrind.
> 
> ---
>  gdb/testsuite/gdb.base/valgrind-db-attach.exp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.base/valgrind-db-attach.exp b/gdb/testsuite/gdb.base/valgrind-db-attach.exp
> index 3be6af5ca9..3e40283a95 100644
> --- a/gdb/testsuite/gdb.base/valgrind-db-attach.exp
> +++ b/gdb/testsuite/gdb.base/valgrind-db-attach.exp
> @@ -51,6 +51,10 @@ set use_gdb_stub 1
>  set test "valgrind started"
>  # The trailing '.' differs for different memcheck versions.
>  gdb_test_multiple "" $test {
> +    -re "valgrind: Unknown option: --db-attach=yes" {
> +	unsupported $test
> +	return -1
> +    }
>      -re "Memcheck, a memory error detector\\.?\r\n" {
>  	pass $test
>      }
>
  
Philippe Waroquiers Oct. 24, 2018, 8:50 p.m. UTC | #2
On Wed, 2018-10-24 at 17:29 +0100, Pedro Alves wrote:
> On 10/24/2018 12:13 PM, Tom de Vries wrote:
> > Hi,
> > 
> > When running valgrind-db-attach.exp with valgrind version 3.13.0, we get:
> > ...
> > PASS: gdb.base/valgrind-db-attach.exp: spawn valgrind
> > valgrind: Unknown option: --db-attach=yes
> > valgrind: Use --help for more information or consult the user manual.
> > ERROR: Process no longer exists
> > UNRESOLVED: gdb.base/valgrind-db-attach.exp: valgrind started
> > ...
> > 
> > The valgrind option --db-attach has been deprecated in version 3.10.0, and
> > removed in version 3.11.0.
> > 
> 
> But was it replaced with / renamed to something else equivalent,
> or the functionality completely eliminated?
--db-attach option functionality was removed, as it was not very
reliable and had a bunch of limitations e.g. not supporting threads.

Instead, the gdbserver embedded in valgrind allows the user debug a process
when valgrind reports an error.

I have put on my list of things to do to convert valgrind-attach
test to use vgdb (but the conversion is probably not trivial).

Philippe
  

Patch

diff --git a/gdb/testsuite/gdb.base/valgrind-db-attach.exp b/gdb/testsuite/gdb.base/valgrind-db-attach.exp
index 3be6af5ca9..3e40283a95 100644
--- a/gdb/testsuite/gdb.base/valgrind-db-attach.exp
+++ b/gdb/testsuite/gdb.base/valgrind-db-attach.exp
@@ -51,6 +51,10 @@  set use_gdb_stub 1
 set test "valgrind started"
 # The trailing '.' differs for different memcheck versions.
 gdb_test_multiple "" $test {
+    -re "valgrind: Unknown option: --db-attach=yes" {
+	unsupported $test
+	return -1
+    }
     -re "Memcheck, a memory error detector\\.?\r\n" {
 	pass $test
     }