I am defining lldb summary strings while debugging a program in Xcode 5, for example

    type summary add -s "${var._operation} ${var._text}" DMDiff 

This works fine. However, when I close Xcode, restart it and continue debugging the session, my summary strings are gone. Saving the project beforehand does not make a difference.

My question is: what is the best way to make these summary strings persist from Xcode session to Xcode session, i.e. have them saved in the project or debug information?

Workaround: I did find out that I can define the summary strings in the ~/.lldbinit file in order to make them persist, and this works. Yet it seems kind of cumbersome, and also is global, not on a per-project basis. I might wish a different summary string for a data type in different projects.

有帮助吗?

解决方案

Note that you can also give summaries a category, by using the "-w" option to type summary add. That way you can group related summaries, and turn them all on and off using the "type category {enable/disable}" commands. If you decide to put your summaries in your .lldbinit, you can then use this trick to switch on the ones that are relevant.

其他提示

You could define these formatters in a file in your project, then make a breakpoint on your app's main(), and associate to it debugger command actions to "command source myFile" and automatically continue

That should do the magic

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top