Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Luis Machado <lgustavo@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Harden tests that deal with memory regions
Date: Thu, 26 Jan 2017 13:17:00 -0000	[thread overview]
Message-ID: <830534b5-d820-d6dd-3d80-3644fcf50f5e@redhat.com> (raw)
In-Reply-To: <1485206680-4402-1-git-send-email-lgustavo@codesourcery.com>

On 01/23/2017 09:24 PM, Luis Machado wrote:

> 2017-01-23  Luis Machado  <lgustavo@codesourcery.com>
> 
> 	* lib/gdb-memory.exp: New file.

Do we need "gdb-" in the file name?

What other procedures to you envision being placed here?  Should
this have "regions" in the file name, like "memory-regions.exp"?
The file's intro comment talks about memory regions.

> 	* lib/gdb.exp: Load gdb-memory.exp

Missing period.

> --- a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
> +++ b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp
> @@ -137,6 +137,9 @@ if ![get_function_bounds "main" main_lo main_hi] {
>      return -1
>  }
>  
> +# Delete all memory regions.
> +delete_memory_regions
> +

The comment as-is practically just reads the function name
in English.  The important detail missing here
is "target-supplied".  So:

 # Delete all target-supplied memory regions.
 delete_memory_regions

Likewise in the other spot.

>  gdb_test_no_output "mem 0x30 0x0 ro"
>  with_test_prefix "0x30 0x0" {
>      region_fail "0x20 0x50"
> diff --git a/gdb/testsuite/lib/gdb-memory.exp b/gdb/testsuite/lib/gdb-memory.exp
> new file mode 100644
> index 0000000..3377011
> --- /dev/null
> +++ b/gdb/testsuite/lib/gdb-memory.exp
> @@ -0,0 +1,38 @@
> +# Copyright 2017 Free Software Foundation, Inc.

The file's non-boilerplate code is copyright 2012, so
preserve that.  (git show 1591a1e8)

> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +# This file was written by Fred Fish. (fnf@cygnus.com)

No it wasn't.

> +
> +# Generic gdb subroutines that should work for any target.  If these
> +# need to be modified for any target, it can be done with a variable
> +# or by passing arguments.

Stale comment.

> +
> +# This file holds functions and data dealing with memory regions manipulation.
> +
> +# Deletes all the memory regions GDB currently knows about.
> +
> +proc delete_memory_regions {} {

Thanks,
Pedro Alves


  reply	other threads:[~2017-01-26 13:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 21:24 Luis Machado
2017-01-26 13:17 ` Pedro Alves [this message]
2017-01-26 17:37   ` Luis Machado
2017-01-26 17:47     ` Pedro Alves
2017-01-26 18:06       ` Luis Machado
2017-01-26 17:41 ` [PATCH,v2] " Luis Machado
2017-01-26 18:03 ` [PATCH,v3] " Luis Machado
2017-01-26 19:32   ` Pedro Alves
2017-01-26 19:54     ` Luis Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=830534b5-d820-d6dd-3d80-3644fcf50f5e@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lgustavo@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox