[lldb-dev] How to use the C++ API? No useful documentation?

Paul Peet via lldb-dev lldb-dev at lists.llvm.org
Sat Feb 20 15:04:00 PST 2016


Hello,

I am currently working on an IDE for C++ and I would like to integrate lldb
as a debugger using the C++ API but it has been difficult for me to
understand the architecture because there is no documentation available
(except doxygen which isn't helpful at all).
I am at the point understanding the Event system? How are Events created?
How can I use SBListener and SBBroadcaster? (What's the function of
SBBroadvaster).

My current code looks something like this:

SBListener listener;
SBProcess process = target.Launch(listener, args, env, nullptr, nullptr,
                                  nullptr, "/home/cynecx/dev/helloWorld",
                                  0, true, error);

process.Continue();

StateType state = process.GetState(); // is stopped

SBEvent event;

while(true) {
  if(listener.WaitForEvent(0xFFFFFFFF, event)) {
    // This branch is never hit
    SBStream stream;
    event.GetDescription(stream);
    std::cout << stream.GetData() << std::endl;
  } else {
    break;
  }
}

It would help developers (IDE) a lot if there might be some
tutorials/documentation on how to use the API.

Regards,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160221/c50cec64/attachment.html>


More information about the lldb-dev mailing list