[lldb-dev] How to load symfile when using debugger.CreateTarget?

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Mon Jan 27 17:07:44 PST 2020


You shouldn't have to specify it if spotlight can see your .dSYM file if you are on a mac. But it would be nice to have an API way to do this. The only way right now is to call the SBTarget::AddModule(...) function, but that won't correctly set the executable file and/or arch for the target correctly . There is a patch up for this:

https://reviews.llvm.org/D70847 <https://reviews.llvm.org/D70847>

You might try:

target = debugger.CreateTarget("myapp", triple, platform_name, add_dependents, lldb.SBError())

followed by:

target.AddModule("myapp", triple, None, "myapp.dsym")

That might end up associating the symbol file for you, while it will re-use the module it first created in the CreateTarget(...) call



> On Jan 25, 2020, at 8:09 AM, Yong Lam via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> Hi all,
> 
> I can specify myapp.dsym in the lldb command line app:
>     target create --no-dependents -arch arm64 --symfile myapp.dsym myapp
> 
> But how can I specify dsym file when using python API? 
> 
> ```
> target = debugger.CreateTarget(
>     "myapp", triple, platform_name, add_dependents, lldb.SBError())
> ```
> 
> I have search in https://github.com/llvm/llvm-project/ <https://github.com/llvm/llvm-project/> and https://lldb.llvm.org/python_reference/index.html <https://lldb.llvm.org/python_reference/index.html> . But cannot solve it.
> 
> 
> Best regards,
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20200127/5bb8db07/attachment.html>


More information about the lldb-dev mailing list