This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] add test for memattr, use get_number_or_range for memattr commands


> 2011-02-19  Michael Snyder  <msnyder@vmware.com>
> 
> 	* memattr.c (mem_enable_command): Use get_number_or_range.
> 	(mem_disable_command): Ditto.
> 	(mem_delete_command): Ditto.

You forgot in the ChangeLog the documentation updates (which should
be reviewed by Eli).

The code changes look fine to me.

> 2011-02-19  Michael Snyder  <msnyder@vmware.com>
> 
> 	* gdb.base/memattr.exp: New test.
> 	* gdb.base/memattr.c: Test load for memattr.exp.

> Index: testsuite/gdb.base/memattr.c
> ===================================================================
> RCS file: testsuite/gdb.base/memattr.c
> diff -N testsuite/gdb.base/memattr.c
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/gdb.base/memattr.c	19 Feb 2011 23:25:11 -0000
> @@ -0,0 +1,11 @@
> +#define MEMSIZE 64

This file needs a copyright header (with the copyright year starting
with 2011 - see below :-).


> Index: testsuite/gdb.base/memattr.exp
> ===================================================================
> RCS file: testsuite/gdb.base/memattr.exp
> diff -N testsuite/gdb.base/memattr.exp
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ testsuite/gdb.base/memattr.exp	19 Feb 2011 23:25:11 -0000
> @@ -0,0 +1,419 @@
> +# Copyright 1998, 1999, 2000, 2007, 2008, 2009, 2010, 2011
> +# Free Software Foundation, Inc.

This is one of these things were I'm not totally sure.  But should
we really claim copyright on this file all the way up to 2011?
ISTM that we can only claim starting in 2011, since this file
was presumably created in 2011.  I don't think that the fact that
you started from another file and duplicated a small part of it
is sufficient to claim that it existed since 1998...

> +gdb_test_multiple "info address mem1" "get address of mem1" {
> +    -re "Symbol \"mem1\" is static storage at address ($hex).*$gdb_prompt $" {
> +	set mem1start $expect_out(1,string)
> +    }
> +}

What happens if this operation fails? I think that the testcase will
badly crash as soon as you start using $mem1start, no? Should we fail
& return? Or just perform all the address extraction first, and then
have a test that verifies the existence of every variable before
continuing with the rest of the test?  I find the latter suggestion
easier to implement, but a little more dangerous.

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]