[Lldb-commits] [PATCH] D58792: Add "operator bool" to SB APIs

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 1 15:01:53 PST 2019

jingham added a comment.

In D58792#1415645 <https://reviews.llvm.org/D58792#1415645>, @clayborg wrote:

> In D58792#1415629 <https://reviews.llvm.org/D58792#1415629>, @zturner wrote:
> > Out of curiosity, are there known, specific examples of users who rely on the exact mangling not changing?
> yes. Xcode. For Swift, Xcode runs the LLDBRPC.framework in process which runs lldb-rpc-server out of process with the DYLD_FRAMEWORK_PATH set to the directory that contains the LLDB.framework that lldb-rpc-server wants to run with. API is very important and without it this would not have been possible. So API is very important.
> That being said, at some point we should make a lldb2 namespace and make a liblldb2.so and cull out all of the fluff we are keeping in there and get down to the exact API we want. We can then change things to be const where needed. remove redundant calls. In the name of backward compatibility we have functions that didn't return an error which now do so we have two versions of similar cal, one with error reporting and one without. Or the 5 flavors of CreateTarget in SBDebugger. There are many others. So at some point it would be nice to go through and reduce and improve the API. That will take time though cause if we do it, we should get it right.

This would be a fun project, however we should not design this by ourselves.  Though we are responsible for the SB API, and those of us who write dotest tests frequently use it some, I bet none of us has written a big application using it.  Greg's probably the closest, with the heap.py and so forth scripts.  However, there are folks out there who have used it extensively.  At Apple, the kernel folks have written a pretty big set of utilities based on the Python API's, and of course the Xcode folks have done so using the C++ API's as well.  And there are likely other folks around who have been using it more extensively.  We could learn a lot from them.

Another really good way to drive the design process by actual example would be to take the opportunity of coming up with the SB2 API's to rewrite everything in source/Commands on top of the new API's.  There are other reasons for doing this (removing duplicated code and testability) but I'm also sure we'd get a lot of good insights into how the design should go doing that.



More information about the lldb-commits mailing list