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

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

Great!

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

    uint32_t
    SBTarget::GetNumBreakpoints () const;

    lldb::SBBreakpoint
    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:

    size_t
    SBBreakpoint::GetNumLocations() const;

    lldb::SBBreakpointLocation
    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
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to