Saturday 15 March 2014

xcode - How do I load multiple lldb type summaries Python files? -


A few times ago, about how to add custom LLDB type summary in Xcode. I found out that we can do this by loading a Python script.

However, I know that there is a way to load many Python files? I work with many different projects, so I have to make 1 summary file and 1 summary file for the project-specific type for the common types used in all my projects.


~ / MyGenericSummaries.py

  Import lldb def __lldb_init_module (debugger, dictionary): debugger. Handle Commands ("Type Summary Addition - Support-String" These words are "Migrant Class");   

~ / MyProjectSummaries.py

  import lldb def __lldb_init_module (debugger, dictionary): debugger. Handle commend ('type summary add - support-string' These are more words "myquoicesclass');           / Pre> 

This publishes MyProjectSummaries.py - LLDB And summary never tells me

Error: Importing module failed: module already imported

whether in different files Is it possible to keep generic summaries and project summaries? This will be really helpful, because I have some kind of names that struggle in different projects, so I turn it off.

Many thanks :) < / P>

OK I got ... with some dragon magic:


~ / MyGenericSummaries.py < Pre> import lldb def doLoad (debugger, dictionary): debugger. Handle Commands ("Type Summary Add - Support-String" These words are "Migrant Class"); Def __lldb_init_module (Debugger, Dictionary): doLoad (Debugger, Dictionary); Import from MyGenericSummaries Import lldb import doLoad def __lldb_init_module (Debugger, Dictionary):


~ / MyProjectSummaries.py

  Import DoLoad (debugger, dictionary); Debugger HandleCommand ("Type Summary Add - Support-String" These are more words "MyProjectClass');   

~ / .lldbinit

  command script import ~ / MyProjectSummaries.py   

The only downside is that I will need to zoom .lldbinit and every time I switch the project, I have to restart Xcode every time , But there is something I can live with.

No comments:

Post a Comment