LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 44659 - Hardware breakpoints are not marked as such on arm/aarch64
Summary: Hardware breakpoints are not marked as such on arm/aarch64
Status: NEW
Alias: None
Product: lldb
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: LLDB commit list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-24 20:53 PST by Jonas Devlieghere
Modified: 2021-09-21 07:05 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Devlieghere 2020-01-24 20:53:51 PST
BreakpointSites know they're backed by hardware based on whether the "hardware index" is set. This does not appear the to be done for arm/aarch64, which caused the hardware breakpoints to appear as software breakpoints. 


2: name = 'hw_break_function'
    2.1: 
      module = /home/buildslave/buildslave/lldb-cmake-aarch64/build/lldb-test-build.noindex/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.test_hw_break_set_disable_multi_thread_linux/a.out
      compile unit = main.cpp
      function = hw_break_function(unsigned int)
      location = /home/buildslave/buildslave/lldb-cmake-aarch64/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/main.cpp:21:57
      address = 0x0000000000400d7c
      resolved = true
      hardware = false
      hit count = 2'
Comment 1 David Spickett 2021-09-21 07:05:01 PDT
I just came across this, I can look into it further if you can remember how you were placing the breakpoints.

At least in some places, we're hardware if we have an index and it's been resolved.

This is what I see with a breakpoint by name at least:

(lldb) breakpoint set -n main --hardware
Breakpoint 1: where = test.o`main + 8 at test.c:11, address = 0x000000000000077c
(lldb) breakpoint list -v
Current breakpoints:
1: name = 'main'
    1.1:
      module = /tmp/test.o
      compile unit = test.c
      function = main
      location = /tmp/test.c:11
      address = test.o[0x000000000000077c]
      resolved = false
      hardware = false
      hit count = 0


(lldb) run
Process 1167457 launched: '/tmp/test.o' (aarch64)
Process 1167457 stopped
* thread #1, name = 'test.o', stop reason = breakpoint 1.1
    frame #0: 0x0000aaaaaaaaa77c test.o`main at test.c:11
   8    Foo f __attribute__((aligned (64))) = { .a=1, .b=2};
   9
   10   int main() {
-> 11     printf("---------------------------\n");
   12     printf("  f.a: %p    f.b: %p\n", &f.a, &f.b);
   13     printf("---------------------------\n");
   14
(lldb) breakpoint list -v
Current breakpoints:
1: name = 'main'
    1.1:
      module = /tmp/test.o
      compile unit = test.c
      function = main
      location = /tmp/test.c:11
      address = 0x0000aaaaaaaaa77c
      resolved = true
      hardware = true
      hit count = 1


(lldb)

What did you do to get the resolved but not hardware state?