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

2016-03-07 Thread John Lindal via lldb-dev
I was planning to take a stab at writing documentation, since I just finished my own C++ app on top of lldb. (Code Medic) Attached is my attempt to add docs to SBAddress. Am I on the right track? If so, I'll tackle additional files. Thanks, John On Mon, Mar 7, 2016 at 10:56 AM, Greg Clayton vi

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

2016-03-07 Thread Greg Clayton via lldb-dev
> On Mar 4, 2016, at 8:08 AM, Paul Peet via lldb-dev > wrote: > > Hi Pavel, > > First of all, thank you for looking into this. I really appreciate it. > Secondly, the check with GetRestartedFromEvent did the trick. > I am finally getting correct information. Thank You very much. I would like

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

2016-03-04 Thread Paul Peet via lldb-dev
Hi Pavel, First of all, thank you for looking into this. I really appreciate it. Secondly, the check with GetRestartedFromEvent did the trick. I am finally getting correct information. Thank You very much. About the documentation, I really think it can be much better and I would also help in thi

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

2016-03-04 Thread Pavel Labath via lldb-dev
Hi Paul, I believe you are experiencing the same problem as a couple of other people before you (see , ). Basically, you need to ignore the events with the "restart

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

2016-03-03 Thread Paul Peet via lldb-dev
Hi Pavel, This is the code: int main() { using namespace lldb; SBDebugger::Initialize(); SBDebugger debugger = SBDebugger::Create(true); if(!debugger.IsValid()) { return 1; } SBTarget target = debugger.CreateTarget("/home/cynecx/dev/helloWorld/main"); if(!target.IsValid()) {

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

2016-03-03 Thread Pavel Labath via lldb-dev
Thanks for the explanation. I'll look this over tomorrow. cheers, pl On 3 March 2016 at 15:23, Paul Peet wrote: > Hi Pavel, > > This is the code: > > int main() { > using namespace lldb; > > SBDebugger::Initialize(); > SBDebugger debugger = SBDebugger::Create(true); > > if(!debugger.IsVa

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

2016-03-03 Thread Pavel Labath via lldb-dev
Hi Paul, I haven't followed this discussion from the start, and I am now having trouble understanding what is the issue at hand here. Could you just briefly repeat what is the problem, and maybe send the code for reproducing the problem again? Maybe I'll be able to help... pl On 3 March 2016 at

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

2016-03-03 Thread Paul Peet via lldb-dev
Sorry to bring this up again, but I am not sure if this is really a linux kernel issue anymore, see the following code: if(event_type == SBProcess::eBroadcastBitStateChanged) { const StateType state = SBProcess::GetStateFromEvent(event); switch(state) { default: continue; case e

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

2016-02-29 Thread Greg Clayton via lldb-dev
> On Feb 28, 2016, at 2:17 PM, Paul Peet wrote: > > Hey, > > Just to let you know that I think I made some progress in determine the > problem. > I've basically setup an vm (archlinux, linux 4.4, lldb 3.7.1) and > tried the code on it. To my surprise it gave me proper output without > non-dete

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

2016-02-28 Thread Paul Peet via lldb-dev
Hey, Just to let you know that I think I made some progress in determine the problem. I've basically setup an vm (archlinux, linux 4.4, lldb 3.7.1) and tried the code on it. To my surprise it gave me proper output without non-determinism. YEY. I still don't have any idea why it's not working on my

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

2016-02-25 Thread Paul Peet via lldb-dev
I updated my code and removed the call to AddListener and as I can tell nothing changed. It is still behaving "strange". It also didn't work with the python example. I couldn't step over the next instruction, so I am getting similar behavior like the c++ code. The strange thing is that at the firs

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

2016-02-24 Thread Jim Ingham via lldb-dev
Yes, the process listener is a little bit special. When you are running a process in the debugger, the process is likely going to be stopping and starting for all sorts of reasons. For instance, stepping through a source line is actually going to: step over the breakpoint at the start pc - i

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

2016-02-24 Thread Greg Clayton via lldb-dev
Not sure. First off, you don't need to do: process.GetBroadcaster().AddListener(...) The debugger's listener is already listening to all the events. If you don't specify a listener during launch the process will use the debugger's listener automatically. If you end up making your own process li

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

2016-02-24 Thread Paul Peet via lldb-dev
I am still getting "non determinism". This is my current code: SBListener listener = debugger.GetListener(); process.GetBroadcaster().AddListener(listener, SBProcess::eBroadcastBitStateChanged | SBProcess::eBroadcastBitSTDO

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

2016-02-24 Thread Greg Clayton via lldb-dev
Here is the fixed code: SBListener listener = debugger.GetListener(); SBLaunchInfo launch_info(args); launch_info.SetEnvironmentEntries(env, true); launch_info.SetWorkingDirectory("/home/dev/helloWorld"); SBProcess process = target.Launch(launch_info, error); process.GetBroadcaster().AddListene

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

2016-02-24 Thread via lldb-dev
Thank you very much for that detailed description on explaining the 'basics'. I got it working so far but there is a small issue with the code I am currently running. When the main loop (there is only one) receives a breakpoint event and I am trying to get the thread description (After the brea

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

2016-02-23 Thread Jeffrey.fudan via lldb-dev
This is a very useful read! I am also building a IDE debugger using lldb, and I found the initial attach/launch API and eventing system has a lot quirks. After getting to stopped state, querying info is relative trivial. Thanks again. Sent from my iPad > On Feb 23, 2016, at 2:40 PM, Greg Clayto

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

2016-02-23 Thread Greg Clayton via lldb-dev
I need to spend some time writing this up, but until then here is some info. We created a python script that uses the LLDB public API to grab async events so people can see how to do things: svn cat http://llvm.org/svn/llvm-project/lldb/trunk/examples/python/process_events.py If you look in he

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

2016-02-23 Thread Jim Ingham via lldb-dev
The Python API is pretty much a mirror of the C++ API's. The process_events.py example: http://llvm.org/svn/llvm-project/lldb/trunk/examples/python/process_events.py should give you a sense of how the broadcasters & listeners are used. Translating that from Python to C++ is quite straightforw

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

2016-02-23 Thread Paul Peet via lldb-dev
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 understandin