[lldb-dev] EvaluateExpression has trailing error

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Mon Aug 24 16:02:03 PDT 2015


That doesn't seem to be right, you had a typename before:

(lldb) pp Ty
Fn(Void -> Int)*
= <unknown error>

Make sure everything is setup and is where you were stopped before and that you use the same "Ty" variable you did before. I have seen function types have newlines in them in the past.

> On Aug 24, 2015, at 3:49 PM, Ramkumar Ramachandra <artagnon at gmail.com> wrote:
> 
> Hm, that doesn't seem to be it.
> 
> (lldb) pp R
> var ~UnType
> typename = ""
> (<invalid>)  = <unknown error>
> 
> On Mon, Aug 24, 2015 at 12:51 PM, Greg Clayton <gclayton at apple.com> wrote:
>> The type name for "Ty" might have a newline in it. Try this:
>> 
>> 
>>   res = frame.EvaluateExpression("%s->dump()" % command)
>>   print >>result, 'typename = "%s"' % (res.GetType().GetName())
>>   print >>result, res
>> 
>> See if the double quote is on the next line.
>> 
>>> On Aug 22, 2015, at 11:58 AM, Ramkumar Ramachandra via lldb-dev <lldb-dev at lists.llvm.org> wrote:
>>> 
>>> Hi,
>>> 
>>> My script is simple enough:
>>> 
>>> import lldb
>>> 
>>> def pp(debugger, command, result, internal_dict):
>>>   target = debugger.GetSelectedTarget()
>>>   process = target.GetProcess()
>>>   thread = process.GetSelectedThread()
>>>   frame = thread.GetSelectedFrame()
>>>   res = frame.EvaluateExpression("%s->dump()" % command)
>>>   print >>result, res
>>> 
>>> def __lldb_init_module(debugger, internal_dict):
>>>   debugger.HandleCommand('command script add -f llvm_pp.pp pp')
>>>   print "Command pp installed"
>>> 
>>> However, when I execute it:
>>> 
>>> (lldb) pp Ty
>>> Fn(Void -> Int)*
>>> = <unknown error>
>>> 
>>> When I use res.GetSummary() in place of res, I get "None" instead of
>>> the error. What is this trailing data anyway, and how do I get rid of
>>> it?
>>> 
>>> Thanks.
>>> 
>>> Ram
>>> _______________________________________________
>>> lldb-dev mailing list
>>> lldb-dev at lists.llvm.org
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_lldb-2Ddev&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=e494ZqshU04UaasD49FjA8X8-41XrPe2DEAUCC4uIBA&m=hREFWCzPJ65eZn31OtjvanOAmZpkHcfxvRV-A7W-jcA&s=ZDMXskG0jb4bfdKZu5O9l2rpbV149UaUmFNvWw1LrRY&e=
>> 



More information about the lldb-dev mailing list