support hw watchpoints/breakpoints on ARMv8.{1,2}

Bug #1608948 reported by dann frazier
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
New
Undecided
Unassigned

Bug Description

[Impact]
gdb reports no hw watchpoint/breakpoint support on ARMv8.1

[Test Case]
Test.c:
int main(void)
{
  int a;
  a = 0;
  a++;
  return a!=1;
}
----- CUT ----
gcc -g test.c -o testprog
apinski@apinski-ss1:~/binutils-gdb$ ./tools/bin/gdb -q a.out
Reading symbols from a.out...done.
(gdb) start
Temporary breakpoint 1 at 0x40050c: file t.c, line 4.
Starting program: /home/apinski/binutils-gdb/a.out

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.

Revision history for this message
dann frazier (dannf) wrote :
Revision history for this message
Robert Richter (rric.cavium) wrote :

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

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

zesty includes fix for this, marking fix released.

Changed in gdb (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.