lldb on BeagleBone Black

Dr. Rolf Jansen rj at obsigna.com
Thu Feb 2 12:05:34 UTC 2017


Am 24.01.2017 um 01:43 schrieb Michal Meloun:

> On 23.01.2017 18:36, Ed Maste wrote:
>> On 16 January 2017 at 09:20, Dr. Rolf Jansen <rj at obsigna.com> wrote:
>>> 
>>> Building and installation of devel/llvm37 from the ports went well without problems, however, lldb37 is only of minor usefulness since stepping-into/over lines of code does not work. I can set breakpoint, and execution stops fine on breakpoints, however, when I hit 'n' or 's', the program simply continues execution in a normal fashion until end.
>> 
>> Yes. Single-stepping on ARM requires special support in the debugger,
>> which does not yet exist in LLDB for FreeBSD. The good news is that
>> there is a patch in review to add this support. I'm hoping to review,
>> test and commit it this week to the upstream LLDB repository, and I'll
>> see about merging it into the LLDB in the FreeBSD base system from
>> there.
>> 
>> -Ed
> 
> There are more problems with LLDB.
> 
> 1) Full LLVM suite, newer that 37, cannot be linked. The resultant size
> of shared library is bigger that 32MB, and our very old linker doesn't
> implements big jump/call stubs.
> For now, cmake .. -DLLVM_TARGETS_TO_BUILD="ARM" works but I think that
> this is also very close to 32MB limit.
> 
> 
> 2) LLDB uses UDF instruction as breakpoint, but FreeBSD kernel expects
> BKPT (see g_arm_breakpoint_opcode in ProcessFreeBSD.cpp). That's why you
> get invalid opcode for single step (and/or breakpoint). My quick attempt
> to replace this with right BKPT opcode also failed, and I think that
> this code also have problem with endianes. Unfortunately, I have no free
> time for this

Finally, a build from SVN-trunk of LLDB went through on my BeagleBone Black, and with that one single stepping works. I utilized ccmake in order to configure -Os for the Release build.

Best regards

Rolf
 



Rolf


More information about the freebsd-arm mailing list