Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Thiago Jung Bauermann <bauerman@br.ibm.com>
Cc: gdb-patches@sourceware.org, Luis Machado <luisgpm@linux.vnet.ibm.com>
Subject: Re: [RFA] Fix verification of changed values for big values.
Date: Thu, 24 Dec 2009 04:41:00 -0000	[thread overview]
Message-ID: <20091224044125.GW2788@adacore.com> (raw)
In-Reply-To: <200912232142.37008.bauerman@br.ibm.com>

> But I don't know if approvals expire or not, so...

I guess it depends whether the code that you're updating has changed
much or not. If not, I'd say that the approval does not expire.

> gdb/
> 	* valarith.c (value_equal_contents): New function.
> 	* value.h (value_equal_contents): Declare.
> 	* breakpoint.c (watchpoint_check): Use value_equal_contents
> 	instead of value_equal.

OK, with just one little request.

> 
> gdb/testsuite/
> 	* gdb.base/watchpoint.exp (test_watchpoint_in_big_blob): New function.
> 	(top level): Call test_watchpoint_in_big_blob.
> 	* gdb.base/watchpoint.c (buf): Change size to value too big for hardware
> 	watchpoints.
> 	(func3): Write to buf.

Just one comment, but pre-approved.

> -/* Check watchpoint condition.  */
>  
>  static int
>  watchpoint_check (void *p)

Can you add a short description of what the function does? We would
like all functions to be documented...  In particular, since P is
declared as a void *, it's probably going to be useful to explain
what the real type is supposed to be.

> +/* Compare values based on their raw contents. Useful for arrays since
                                                 ^ Missing space

> +    send_gdb "cont\n"
> +    gdb_expect {
> +	-re "Continuing.*\[Ww\]atchpoint.*buf.*Old value = .*$gdb_prompt $" {
> +	    pass "watchpoint on buf hit"
> +	}

I am wondering if this could be written more simply, by using gdb_test?

gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*buf.*Old value = .*" [...]

? Otherwise, we try to avoid the use of send_gdb/gdb_expect, as it
forces you to handle by hand all possible failure conditions. You can
use gdb_test_multiple instead. For instance:

  | gdb_test_multiple "next" "next after watch x" {
  |     -re ".*atchpoint \[0-9\]+: x\r\n\r\nOld value = 0\r\nNew value = 1\r\n.*$gdb_prompt $" {
  |         pass "next after watch x"
  |     }
  |     -re "\[0-9\]+\[\t \]+y = 1;\r\n$gdb_prompt $" {
  |         kfail "gdb/38" "next after watch x"
  |     }

(notice how you know longer need to handle eof, timeout, but also
internal errors, etc)

-- 
Joel


  reply	other threads:[~2009-12-24  4:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 23:43 Thiago Jung Bauermann
2009-12-24  4:41 ` Joel Brobecker [this message]
2009-12-30 17:38   ` Thiago Jung Bauermann
2009-12-30 19:22     ` Joel Brobecker
2009-12-30 19:48       ` Joel Brobecker
2009-12-30 20:00       ` Thiago Jung Bauermann

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=20091224044125.GW2788@adacore.com \
    --to=brobecker@adacore.com \
    --cc=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=luisgpm@linux.vnet.ibm.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