[lldb-dev] debugging when the target is a boot loader

Jason Molenda jason at molenda.com
Fri Apr 17 21:16:37 PDT 2015


> On Apr 17, 2015, at 3:32 PM, Ted Woodward <ted.woodward at codeaurora.org> wrote:
> 
> One of my customers brought a new use case to me yesterday. He runs a bootloader, that loads the actual program that he wants to debug.
>  
> We’re using a simulator, which my Hexagon Platform can launch and connect to. I launch the simulator with the target to run (the boot loader) and arguments from target.run-args, consisting of args for the simulator, followed by “--“ and args for the target. In this case, args for the bootloader include the ELF file (which I’ll call the secondary) that it should load and run.
>  
> I tried using “target modules add” to add the secondary, but breakpoints I set on its symbols weren’t hit.

Ted, in this kind of environment it's often necessary to set the load address of the modules manually.  There is no dynamic loader in this environment which tells lldb where solibs are loaded in memory.  "target modules add" adds the Module to the Target but until lldb is told where that is loaded in memory, it won't have load addresses and I'm guessing breakpoints won't actually be written into memory.

Try the "target modules load" command after you've "target modules add"ed the second file.

J



More information about the lldb-dev mailing list