Test 1: Building on linux pure-cap, building ARM's standard examples e.g helloworld. Inside lldb, set breakpoint at main and run. Does not halt, program runs to completion.
Test 2: Build for linux-aarch64-gnu, i.e without pure-cap flag, and perform the same lldb actions. Works fine - program halts at main.
Test 3: Build for linux-aarch64-gnu as per test 2 but THEN use the morello_elf tool to patch the purecap flag in the executable then lldb does not work in the same way as observed in test 1.
I suspect I am doing something silly, but I cannot figure out what - but I suspect it is something obvious I have missed! Please help.
- In all cases, in lldb process launch -s will indeed stop at the entry point
- lldb reports breakpoints are being set correctly in all cases. Also doing a memory dump shows the address is correct (I tried setting breakpoint via address and at printf() also).
- In all cases, program runs normally outside the debugger
- When debugging the heap test example, lldb shows the seg fault as expected including the source trace.
(lldb) br set -n main
Assuming this is all supposed to work, any pointers to something obvious I have missed would be appreciated. This is all running on Morello board with a linux pure-cap stack installed on the SATA ssd, lldb running on the target also (i.e not remote debugging). I will also try debugging with gnu tools (gdb).
Finally got a chance to try it with GNU toolchain, and it seems to work ok with gdb i.e it does halt at the breakpoint even for pure-cap. So an LLVM issue I guess?
Using morello_elf to set the purecap ELF flag on a non-purecap binary would definitely be an unsupported use case for lldb since the binary is not really purecap. We do have end-to-end tests (which include testing that breakpoints work in purecap), however this is only tested on Android. If you encounter bugs with lldb it might be easier to raise an issue at https://git.morello-project.org/morello/llvm-project.
Thanks Silviu, will register for the gitlab access and raise an issue there as you suggest.