This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING] [PATCH] Enable hardware watchpoints on attach for aarch64
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Alan Hayward <Alan dot Hayward at arm dot com>
- Cc: Richard Bunt <Richard dot Bunt at arm dot com>, gdb-patches at sourceware dot org, nd <nd at arm dot com>, Dirk Schubert <Dirk dot Schubert at arm dot com>
- Date: Mon, 11 Jun 2018 21:37:59 -0400
- Subject: Re: [PING] [PATCH] Enable hardware watchpoints on attach for aarch64
- References: <17719981-eb06-6e22-6d3e-6bfe6ae411ba@arm.com> <3832a623-3a34-2574-5b86-bba9e9728fb8@arm.com> <BDFF5B49-0B39-475D-A7BD-2B330513866A@arm.com>
On 2018-06-07 09:19, Alan Hayward wrote:
Aarch64 changes look good to me.
I’m not up to speed enough with .exp files to comment on that part.
I tested it on an aarch64 box, and it works fine for me.
Hi,
I looked at the test, if Alan is fine with the code changes then I am
fine with them. I noted some nits, but otherwise it looks good. Please
push after addressing them.
+# Get the PID of the test process.
+set testpid ""
+set test "get inferior process ID"
+ gdb_test_multiple "p mypid" $test {
+ -re " = ($decimal)\r\n$gdb_prompt $" {
+ set testpid $expect_out(1,string)
+ pass $test
+ }
+}
You can use get_integer_valueof for this.
+set test "attach $testpid"
+gdb_test_multiple $test $test {
+ -re "Attaching to program.*process $testpid\r\n.*$gdb_prompt $"
{
+ pass "$test"
+ }
+ timeout {
+ fail "$test"
+ }
+}
Just wondering, can't simple gdb_test be used here?
+
+gdb_test_no_output "set should_continue = 1"
+# Ensure the test program is in the top frame so the required
+# variables are in scope.
+gdb_breakpoint [gdb_get_line_number "prewatchtrigger"]
+gdb_continue_to_breakpoint "prewatchtrigger"
+
+gdb_test "watch watched_variable" \
+ "Hardware watchpoint $decimal: watched_variable"
+
+gdb_test "continue" \
+ "continue.*Continuing.*\.Hardware watchpoint $decimal:\
+ watched_variable.*Old value = 0.*New value = 4.*"
8 spaces -> tab on the last line. Though for test patterns, it's fine
to go over 80 columns, IMO.
Simon