Approach for Integrating LLDB Plugin

RISHABH GUPTA rishabh9511 at gmail.com
Tue Mar 15 19:28:12 UTC 2016


To show that the LLDB/MI commands can be handled by the GDB plugin I am
attaching a few  screen shots which will show the commands being given and
the output being returned

1.When the breakpoint is hit
2. Step-in
3.Continue

I accept that  variables and stack don't update right now but  since the
output being returned is almost similar to what GDB/MI  returns
it won't be that difficult to make them working with the existing code

The thing is according to the approach that I mentioned in the last mail ,I
would be required to change the code  of debugsession.cpp
,gdbconfigpage.cpp and other files that start GDB and then  move on to the
files responsible for handling the output .

I think the attached screen shots will give a good proof that LLDB/MI and
GDB/MI are compatible.

I am more than willing to work on this project.

Hoping for some feedback :)



On Sun, Mar 13, 2016 at 7:10 PM, RISHABH GUPTA <rishabh9511 at gmail.com>
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.
>
> *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-driver
> 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/7535162178eada833e72a5525fc26dcc04e7331e/tools/lldb-mi/MICmdCommands.cpp
> lists all the MI command that have been implemented.
>
> 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.
>
> I also had a discussion with Vladimir Prus(one of the authors of GDB
> plugin) ,he said it's mostly the same plugin .
>
>
> Thank you :)
> Rishabh Gupta
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160316/ee7cc010/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: breakPointHit.png
Type: image/png
Size: 94801 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160316/ee7cc010/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: completeOutput.png
Type: image/png
Size: 99325 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160316/ee7cc010/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stepIn.png
Type: image/png
Size: 92505 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160316/ee7cc010/attachment-0005.png>


More information about the KDevelop-devel mailing list