[Lldb-commits] [PATCH] D109738: [lldb] Fix bug 38317 - Address breakpoints don't work if set before the process launches

Ted Woodward via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 14 14:30:50 PDT 2021


ted added a comment.

I created the original bug because a change made LLDB stop working on address breakpoints if they were created before the program is run. Setting a breakpoint on an address is a typical case with embedded applications, especially if you want to debug startup code.

I took this patch and applied it to the latest downstream Hexagon repo. It behaved as expected - I set a breakpoint at the address of main, ran, and it stopped at the breakpoint. Before this patch, the breakpoint wouldn't be resolved.

Thanks, Vadim!

(lldb) p main
(int (*)(int, unsigned char **)) $0 = 0x00005128
(lldb) b 0x5128
Breakpoint 1: address = 0x00005128
(lldb) br l
Current breakpoints:
1: address = 0x0000000000005128, locations = 1

  1.1: address = 0x00005128, unresolved, hit count = 0 

(lldb) r
Process 1 launched: '/usr2/tedwood/lldb_test/factorial' (hexagon)
Process 1 stopped

- thread #1, name = 'T1', stop reason = breakpoint 1.1 frame #0: 0x00005128 factorial`main(argc=-1161904401, argv=0x00005bac) at factorial.c:13 10   } 11 12   int main(int argc, char **argv)

-> 13   {

  14     unsigned base;
  15  
  16   /*

(lldb) re r pc

  pc = 0x00005128  factorial`main at factorial.c:13

(lldb) br l
Current breakpoints:
1: address = 0x00005128, locations = 1, resolved = 1, hit count = 1

  1.1: address = 0x00005128, resolved, hardware, hit count = 1 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109738/new/

https://reviews.llvm.org/D109738



More information about the lldb-commits mailing list