This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] watchpoint-reuse-slot.exp: skip some tests on targets have different wp and bp registers
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 16 Mar 2015 15:23:13 +0000
- Subject: Re: [PATCH 1/2] watchpoint-reuse-slot.exp: skip some tests on targets have different wp and bp registers
- Authentication-results: sourceware.org; auth=none
- References: <1426257692-30461-1-git-send-email-qiyaoltc at gmail dot com> <5506CDF2 dot 4090400 at redhat dot com> <864mplghxp dot fsf at gmail dot com>
On 03/16/2015 02:01 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> Hmm, is this just to save test time? If so, I'd prefer not skipping,
>> as it may always catch other bugs, in the target backends or
>> the kernel.
>
> No, watchpoint-reuse-slot.exp sets some HW breakpoint/watchpoint on some
> address doesn't meet the alignment requirements by kernel, kernel
> will reject the ptrace (PTRACE_SETHBPREGS) call, and some fails are
> caused, for example:
OK, then different wp and bp registers really is an orthogonal
predicate. A better one is around the alignment requirements
of a breakpoint.
>
> (gdb) PASS: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 0: delete $bpnum
> hbreak *(buf.byte + 0 + 1)^M
> Hardware assisted breakpoint 80 at 0x410a61^M
> (gdb) PASS: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 1: hbreak *(buf.byte + 0 + 1)
> stepi^M
> Warning:^M
> Cannot insert hardware breakpoint 80.^M
> Could not insert hardware breakpoints:^M
> You may have requested too many hardware breakpoints/watchpoints.^M
> ^M
> (gdb) FAIL: gdb.base/watchpoint-reuse-slot.exp: always-inserted off: watch x hbreak: : width 1, iter 0: base + 1: stepi advanced
>
> hbreak *(buf.byte + 0 + 1)^M
> Hardware assisted breakpoint 440 at 0x410a61^M
> Warning:^M
> Cannot insert hardware breakpoint 440.^M
> Could not insert hardware breakpoints:^M
> You may have requested too many hardware breakpoints/watchpoints.^M
> ^M
> (gdb) FAIL: gdb.base/watchpoint-reuse-slot.exp: always-inserted on: watch x hbreak: : width 1, iter 0: base + 1: hbreak *(buf.byte + 0 + 1)
>
> Do you suggest that we don't skip these tests even requested
> breakpoint/watchpoint don't go in the same slot (debugging register)?
Yes.
> so
> that the test can cover more. If the requested address of HW
> breakpoint/watchpoint doesn't meet the arch/kernel requirements, we can
> skip it, is it OK?
Yes, that makes sense.
>
> The inner loop of test has two parts, "base + 0" and "base + 1",
>
> append prefix "$cmd1 x $cmd2: "
> with_test_prefix "$prefix: width $width, iter $x" {
> with_test_prefix "base + 0" {
> watch_command $cmd1 $x 0 $width
> stepi
> gdb_test_no_output "delete \$bpnum"
> }
> with_test_prefix "base + 1" {
> watch_command $cmd2 $x 1 $width
> stepi
> gdb_test_no_output "delete \$bpnum"
> }
> }
>
> if we skip "base + 1" part, do we skip "base + 0" too? if not, prefix in
> test summary "$cmd1 x $cmd2: " doesn't reflect the fact.
I think skipping both is fine.
Thanks,
Pedro Alves