[lldb-dev] SBFunction::Invoke?

Greg Clayton gclayton at apple.com
Fri Sep 19 15:16:12 PDT 2014


I just spoke with Jim Ingham and he change my mind. If, every time you stop, you want to call a function, this feature could come in handy.

Behind the curtains it should:
- install a ClangFunction down in the host and leave it there so it can be called (we do this internally with a few functions)
- allow it to be called with a SBValueList. All arguments will need to manually be supplied (the "this", and ObjC "cmd" and "selector" arguments, etc)
- it should be able to be uninstalled from the target


> On Sep 19, 2014, at 3:00 PM, Greg Clayton <gclayton at apple.com> wrote:
> 
> I would really rather us (LLDB) not get into the the function argument passing game and leave that to the pros (clang) and just use the expression parser which does all this for us correctly. 
> 
>> On Sep 19, 2014, at 2:05 PM, Carlo Kok <ck at remobjects.com> wrote:
>> 
>> On Fri, 19 Sep 2014 21:06:35 +0200, <jingham at apple.com> wrote:
>> 
>>> I think it would make more sense to have this be something that hangs off of SBFunction, and have the implementation opaque to the SB API's.  To do that' you're probably going to have to stash the ClangFunction away in the lldb_private::Function, since you can't change the size of SBFunction (another of our API promises...) and it is just one pointer big, so life-time would be hard to manage.
>>> 
>>> 
>> 
>> yeah, I'll try to look into this next week.
>> 
>> For ObjC I'd probably have to cast the right msgsend/msgsend_stret/msgsnd_fpret to a function type matching the sig of the member function, get the right selector and cache/invoke that, or is there a shorter way about this?
>> 
>> -- 
>> Carlo Kok
>> RemObjects Software
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> 
> _______________________________________________
> 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