Approach for Integrating LLDB Plugin

Kevin Funk kfunk at kde.org
Wed Mar 16 19:23:16 UTC 2016


On Sunday, March 13, 2016 7:10:37 PM CET RISHABH GUPTA wrote:
> Hello all,
> 
> 
> I have already started working on Integrating the plugin and have uploaded
> my work  here https://github.com/rish9511/kdevelop/tree/lldbtest .
> 
> The approach I followed while working is going to result in a lot of code
> duplication which is not good.
> 
> *New approach:*
> 
> Most of the classes like DebugSession,DebuggerPlugin ,DebugJob, etc are
> going to be  re-used in both the plugins so it's better to make  changes in
> the existing code and then make  GDB and LLDB use  them.

Yes, that sounds like what I had in mind. We need to generalize the GDB MI 
infrastructure, and then reuse as much as possible in the LLDB plugin.

Hopefully that will also streamline the GDB plugin code (it needs some serious 
love).

> *LLDB/MI and GDB/MI compatibility:*
> 
> They  both are compatible.Any IDE that supports the GDB/MI protocol should
> be able to use the MI driver .This has been mentioned  on codeplay's site
> https://www.codeplay.com/portal/lldb-mi-driver---part-2-setting-up-the-drive
> r I cross checked this after Kevin Funk suggested me to see if the commands
> sent by GDB plugin work with lldb-mi or not.Most of the commands worked
> like a charm.
> https://github.com/llvm-mirror/lldb/blob/7535162178eada833e72a5525fc26dcc04e
> 7331e/tools/lldb-mi/MICmdCommands.cpp lists all the MI command that have
> been implemented.

Okay.

> So updating variables ,stack won't be an issue at all .
> 
> *Commands that have not been implemented:*
> The non MI commands like "n" ,"list","step","continue" ,"b main.cp:7" ,etc
> have not been implemented but for most of them corresponding commands exist
> .
> 
> 1. n = -exec-next
> 2. step = -exec-step
> 3 . continue = -exec-continue
> 4. b main.cpp:line_no = -break-insert --option "file name"
> 
> couldn't find a command for "list".
> So if the user gives any of the non-MI command we can conditionalize and
> give the corresponding command.

Wait a second: The user is not supposed to type in MI commands. That's what 
the plugins take care of. The plugin sends out MI commands when the user 
presses the Continue/Step Into/Step Out/... functions, for instance. Or when 
selecting another stack frame in the Frame Stack view.

The user is supposed to use plain GDB/LLDB commands in the GDB/LLDB command 
prompt in the UI.
 
> I also had a discussion with Vladimir Prus(one of the authors of GDB
> plugin) ,he said it's mostly the same plugin .

Let's hope it is :)

> Thank you :)
> Rishabh Gupta

Looking forward to your proposal.

Cheers,
Kevin

-- 
Kevin Funk | kfunk at kde.org | http://kfunk.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160316/c97d67f5/attachment.sig>


More information about the KDevelop-devel mailing list