[Lldb-commits] [PATCH] Extend SBPlatform with capability to launch/terminate a process remotely. Integrate this change into test framework in order to spawn processes on a remote target.

jingham at apple.com jingham at apple.com
Tue Feb 3 15:33:51 PST 2015


BTW, I wrote up the rules for the SB API objects here:

http://lldb.llvm.org/SB-api-coding-rules.html

Feel free to add to this if there's anything that isn't clear.

Jim


> On Feb 3, 2015, at 1:14 PM, Greg Clayton <clayborg at gmail.com> wrote:
> 
> Also one thing to note: if you add anything to the lldb::SB API, you can only have one member variable: a pointer, an std::unique_ptr<> or a std::shared_pointer<>. Why? Because we are vending a C++ interface and you can't change the size of the class. When people link against the lldb.so, they need a consistent API and layout of classes in case they make classes that inherit from or use a lldb::SB class so the layout can never change. So to work around this we have rules:
> 
> 1 - lldb::SB classes have one ivar (ptr, unique_ptr, or shared_ptr) which abstracts you from your implementation and makes sure the size of the lldb::SB object never changes
> 2 - no virtual functions so that all function lookups are based off of a pure name lookup by the dynamic linkers (no vtable that can change on you)
> 3 - No inheritance, or only inheritance based on other lldb::SB classes that obey the same rules





More information about the lldb-commits mailing list