[lldb-dev] frontent for LLDB

Greg Clayton gclayton at apple.com
Wed Jul 6 16:13:25 PDT 2011

On Jul 6, 2011, at 2:27 PM, Andrey Zaytsev wrote:

> Hello everyone!
> I'm working on lldb front-end for AppCode project. 


> I faced with real lack of documentation about API and I have question about SBListeners and SBEvents. I can't find a way to get information about subject of event. 

Johnny Chen is in the process of documenting our entire public API as we speak, so in a week or so we should have all of the documentation. 

> I received event about breakpoint change (eBroadcastBitBreakpointChanged). How can I get what's exactly changed.

Currently not much is exported through the public API. Internally the breakpoint that is changed currently can have data in the event that specifies:

        eBreakpointEventTypeAdded               = (1u << 1),
        eBreakpointEventTypeRemoved             = (1u << 2),

And the event also contains the breakpoint that is affected. Currently you could just use the SBTarget breakpoint API to walk over all breakpoints and figure out if any were added/removed:

    SBTarget::GetNumBreakpoints () const;

    SBTarget::GetBreakpointAtIndex (uint32_t idx) const;

Each breakpoint has a unique monotonically increasing integer identifier which can always be used to identify if the breakpoint is one that you have already seen and added to your UI. Each breakpoint also has zero or more locations (a breakpoint can have zero locations if you say have a breakpoint set at a function by name which will eventually appear in a shared library that has not yet been loaded). A breakpoint might suddenly get more locations as your program runs so you might want to use:

    SBBreakpoint::GetNumLocations() const;

    SBBreakpoint::GetLocationAtIndex (uint32_t index);

to walk through all locations.

So really, just watch for these events and update your breakpoint list if it is visible.

> The same question is about Interrupt(eBroadcastBitInterrupt). How can I figure out what's the reason of interrupt.

This really isn't being used right now so you can ignore it!

> I can get answers by reading source code but it's quite complicated way ;-)

Yep! Keep asking questions if as you run into them and we will do our best to answer them!

> I found LLDB is really cool replacement of mess with gdb MI!

Happy to hear it!

> API is really self-describing but not in some semantics points. 

You can also check out how the Driver.cpp uses the API as an example (this is the command line driver).

> Thanks in advance, guys.

> _______________________________________________
> 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