<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi John,</div><div>replies are inlined</div><div><br></div><div><div>On Feb 20, 2012, at 1:46 PM, John Firebaugh wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I'm having trouble getting a custom type summary to work. I can get a<br>basic `type summary add --python-script` command to work, but not the<br>-P or -F options. -P segfaults, and -F just doesn't seem to work.<br><br></div></blockquote><div><br></div><div>the segfault with -P is fixed in ToT LLDB</div><div><br></div><div>as for -F, it works. The problem in your sample command</div><div><span class="Apple-style-span" style="font-family: helvetica, arial, freesans, clean, sans-serif; font-size: 11px; line-height: 14px; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font: normal normal normal 12px/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; line-height: 1.4em; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; "><blockquote type="cite"><div class="line" id="LC13" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; ">(lldb) command script import ~/ruby.py</div><div class="line" id="LC14" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; ">ready!</div><div class="line" id="LC15" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; ">(lldb) type summary add -F ruby_value VALUE</div></blockquote></pre></span>is that it is ignoring modules. When you load a file named ruby.py, Python loads its contents in a module named 'ruby'.</div><div>Hence, your function is not really named ruby_value but ruby.ruby_value</div><div>If you really need it to be named ruby_value then you need to drop into the interactive interpreter, and from ruby import *</div><div>then names will go into the global namespace, and ruby_value will be a valid Python function name</div><div>If either one of these does not work, then please let us know since it may be a genuine issue :)</div><br><blockquote type="cite"><div>Here's what I'm doing: <a href="https://gist.github.com/1871632">https://gist.github.com/1871632</a><br><br>Any ideas? Is the llvm included with Xcode 4.3 already too old for this feature?<br><br>Also, I was held up temporarily by a few documentation errors:<br><br>In varformats.html, "or somehow loaded it from a file, using the<br>`script import` command" should read "or somehow loaded it from a<br>file, using the `command script import` command".<br><br></div></blockquote><div><br></div><div>Not really a typo..They are two different commands.</div><div><br></div><div>script import foo</div><div>is the same as entering the interactive interpreter, typing import foo as a command and then quitting the interactive interpreter</div><div><br></div><div>command script import ~/foo.py</div><div>is an LLDB command that tries to import whatever script module might be stored in file foo.py in the user's home folder</div><div><br></div><div>provided that ~ is in your Python path, the two should most probably be equivalent</div><div><br></div><blockquote type="cite"><div>In python-reference.html, there are several references to<br>__lldb_module_init that should be __lldb_init_module.<br><br></div></blockquote><div><br></div><div>This is a true issue with the docs. Needs to fixed.</div><br><blockquote type="cite"><div>Thanks,<br>John<br><br></div></blockquote></div><br><div>Thanks for your feedback :)</div><div><br></div><div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="font-style: normal; "><i>- Enrico Granata</i></div><div><i><br></i></div></span></div></div></body></html>