[lldb-dev] Python API: Evaluating commands with specified language
Jason Molenda
jason at molenda.com
Fri Dec 26 15:33:23 PST 2014
This change was around June 2014, it is included in Xcode 6 which was released around September 2014. The API won't exist in Xcode 5 installations, but I don't think that's a large number of users.
Yeah we need to figure out how to regenerate the on-line API documentation, I don't know exactly how Dan generated it. It's about a year and a half old at this point.
> On Dec 25, 2014, at 11:33 PM, Michail Pishchagin <mblsha at gmail.com> wrote:
>
> Thanks, it works!
>
> And I'm trying to get language based on current frame — it seems that SBCompileUnit.GetLanguage() was added very recently in r222189. Will it be added to the Xcode 6 updates?
>
> P.S. Python API reference (http://lldb.llvm.org/python_reference/) is badly outdated — it says that it was generated back in 2013, and it looks that I have to rely on SB* headers in lldb repository to get up-to-date info.
>
>> On 26 дек. 2014 г., at 1:28, Jason Molenda <jason at molenda.com> wrote:
>>
>> Hi Michail,
>>
>> Try the SBFrame::EvaluteExpression(const char *expr, const SBExpressionOptions &options) method where you've specified the language in the SBExpressionOptions object.
>>
>> J
>>
>>> On Dec 24, 2014, at 12:11 AM, Michail Pishchagin <mblsha at gmail.com> wrote:
>>>
>>> Hi!
>>>
>>> I've been trying to get https://github.com/facebook/chisel to work on Swift targets, and so far noticed one issue: while I'm stopped inside Swift code, all SBFrame.EvaluateExpression() calls are evaluated as if they're in Swift, not in Objective-C (this is what Chisel expects).
>>>
>>> It's very easy to reproduce the issue using just default prompt:
>>>
>>> (lldb) e (id)objc_getClass("NSClipView")
>>> error: <EXPR>:1:5: error: consecutive statements on a line must be separated by ';'
>>> (id)objc_getClass("NSClipView")
>>> ^
>>> ;
>>>
>>> (lldb) script
>>> Python Interactive Interpreter. To exit, type 'quit()', 'exit()'.
>>>>>> value = lldb.frame.EvaluateExpression('(id)objc_getClass("NSClipView")')
>>>>>> str(value.GetError())
>>> 'error: <EXPR>:1:5: error: consecutive statements on a line must be separated by \';\'\n(id)objc_getClass("NSClipView")\n ^\n ;'
>>>
>>> (lldb) e -l objective-c++ -- (id)objc_getClass("NSClipView")
>>> (id) $1 = 0x00007fff7c259440
>>>
>>> I've looked at LLDB Python API (http://lldb.llvm.org/python_reference/), and was unable to find a way to explicitly specify a language using EvaluateExpression call. Is there a way to do so?
>>>
>>> -Michail
>>> _______________________________________________
>>> lldb-dev mailing list
>>> lldb-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>
>
More information about the lldb-dev
mailing list