support hw watchpoints/breakpoints on ARMv8.{1,2}
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gdb (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
New
|
Undecided
|
Unassigned |
Bug Description
[Impact]
gdb reports no hw watchpoint/
[Test Case]
Test.c:
int main(void)
{
int a;
a = 0;
a++;
return a!=1;
}
----- CUT ----
gcc -g test.c -o testprog
apinski@
Reading symbols from a.out...done.
(gdb) start
Temporary breakpoint 1 at 0x40050c: file t.c, line 4.
Starting program: /home/apinski/
Temporary breakpoint 1, main () at t.c:4
4 a = 0;
(gdb) hb 5
Hardware assisted breakpoint 2 at 0x400510: file t.c, line 5.
(gdb) c
Continuing.
Breakpoint 2, main () at t.c:5
5 a++;
(gdb)
This fails on ARMv8.1 platforms w/o the patch.
[Regression Risk]
Patch is a clean cherry pick from upstream that just adds code to detect 8.1 & 8.2 chip debug types.
On 02.08.16 08:40:59, Dann Frazier wrote:
> I ran this test on our 2.0 silicon - which I *thought* was supposed to
> be ARMv8.1 - but it passes there.
> Can you confirm if that should be the case?
With newer firmware (e.g. 1.23.6 from Jul 22 2016) this no longer happens for 2.0 systems. You can reproduce it with older firmware (e.g. 1.21.3), see here:
good:
(gdb) break main
Breakpoint 1 at 0x4005c8: file main.c, line 5.
(gdb) run
Starting program: /root/test/main
Breakpoint 1, main () at main.c:5
5 printf("Hello world.\n");
bad:
(gdb) break main
Breakpoint 1 at 0x4005c8: file main.c, line 5.
(gdb) run
Starting program: /root/test/main
warning: Unable to determine the number of hardware watchpoints available.
warning: Unable to determine the number of hardware breakpoints available.
Breakpoint 1, main () at main.c:5
5 printf("Hello world.\n");
-Robert