<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.gmail-m6720070647917843543apple-converted-space
{mso-style-name:gmail-m_6720070647917843543apple-converted-space;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">That’s probably the best thing to do. lldb-mi is no longer officially part of lldb, so it is not supported by the lldb community. lldb-vscode is officially part of lldb, and if it breaks we can go yell at Greg!
<span style="font-family:"Segoe UI Emoji",sans-serif">😊</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> lldb-dev <lldb-dev-bounces@lists.llvm.org> <b>On Behalf Of
</b>Rocky Bernstein via lldb-dev<br>
<b>Sent:</b> Thursday, September 12, 2019 9:48 PM<br>
<b>To:</b> Adrian Prantl <aprantl@apple.com><br>
<b>Cc:</b> LLDB <lldb-dev@lists.llvm.org><br>
<b>Subject:</b> [EXT] Re: [lldb-dev] lldb access in Emacs via realgud<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Your guess is as good as mine. The one you project link you give looks more akin to what I was looking for. <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">At any rate, rather than try to fix up lldb-mi, I'd put my (limited) resources into using one of these and beefing it up if it needs improvement. <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Sep 12, 2019 at 10:33 PM Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Sep 12, 2019, at 4:45 PM, Rocky Bernstein <<a href="mailto:rb@dustyfeet.com" target="_blank">rb@dustyfeet.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">On Thu, Sep 12, 2019 at 5:51 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>> wrote:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><br>
<br>
> On Sep 12, 2019, at 2:24 PM, Rocky Bernstein <<a href="mailto:rb@dustyfeet.com" target="_blank">rb@dustyfeet.com</a>> wrote:<br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
> On Thu, Sep 12, 2019 at 3:37 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>> wrote:<br>
>><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>> > On Sep 11, 2019, at 1:08 AM, Rocky Bernstein via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
>> ><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>> ><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>> > Hi - I just wanted to mention that if there are emacs users there is an interface to lldb via realgud. See<span class="gmail-m6720070647917843543apple-converted-space"> </span><a href="https://github.com/realgud/realgud-lldb" target="_blank">https://github.com/realgud/realgud-lldb</a><br>
>> ><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>> > A MELPA package and ELPA packageElpa package are available too<span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>> Nice. It's always exciting to see wider adoption through better editor integration. Out of curiosity, how does this compare to regular gud.el? (<a href="https://opensource.apple.com/source/lldb/lldb-69/utils/emacs/gud.el.auto.html" target="_blank">https://opensource.apple.com/source/lldb/lldb-69/utils/emacs/gud.el.auto.html</a>)<br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
> "Regular" gud? The most recent copyright on that link is 2008. I see a gud.el in 26.2 and in the GNU savannah git sources, but neither mentions lldb. Assuming that file is really from 2008, has lldb changed since then? (This is a rhetorical question). But
the broader question is really who is maintaining that file you link, clearly it is not the GNU Emacs community. And how easy is it to do so? I see an "arch" tag on the file, so I guess this in version control somewhere. But if there is a bug in this file,
what does one do? (This is not a rhetorical question; if you know the answer, I am interested.)<br>
<br>
I think this file is effectively abandoned as it is neither part of the LLDB repository nor is it shipping with emacs in macOS any longer.<br>
<br>
> Adapted from<span class="gmail-m6720070647917843543apple-converted-space"> </span><a href="https://github.com/realgud/realgud/blob/master/realgud.el" target="_blank">https://github.com/realgud/realgud/blob/master/realgud.el</a><br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>> Here we make use of more modern programming practices, more numerous and smaller files, unit tests, and better use of Emacs primitives, e.g. buffer marks, buffer-local variables, structures, rings, hash tables. Although there is still much to be desired,
this code is more scalable and suitable as a common base for an Emacs front-end to modern debuggers.<br>
>> Oh, and because global variables are largely banned, we can support several simultaneous debug sessions.<br>
<br>
> gdb-mi has a nicer multi-frame display, but you were linking to gud.el which doesn't have that as far as I know. realgud-lldb at this point probably knows more about lldb. But you guys can probably verify that, and if realgud-lldb is lacking, I'd be interested
to learn what should be added.<span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
> gud has always been a bit too monolithic - it contains every debugger (including some obsolete ones - does anyone really still use dbx, and if so inside Emacs?). All of this is in that one several-thousand-line file. I find this ironic because the principal
author is wrote something about "Cathedral versus Bazaar" and this is clearly Cathedral style.<span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
> It took me quite a while to be able to break realgud into several distinct files. In fact I had to write my own nodejs-like "require" package to be able to do internal or relative module linking. And then after that, more work was done to split off the debuggers
from the core debugger module into separate github projects.<br>
<br>
Thanks for explaining the differences!<br>
<br>
Is realgud scraping lldb's console output like gud was or is it using the LLDB scripting API? If it isn't already you might want to consider using the scripting API since LLDB's console output is not necessarily stable, but the scripting API is.<o:p></o:p></span></p>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">Yes, it scrapes console output and that is a problem. A big problem.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">I looked at the LLDB API and that seems pretty extensive and seems to cover a lot more of what interaction from Emacs would like and is currently missing.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">However as is in its current state, this isn't going to cut it because Emacs uses its own Lisp, not Python.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">I have toyed with the idea of hooking into something more standard, and as I said, there are so many to choose from. For example, the V8 debugger protcol works over a websocket,
and speaking over a websocket is something you can expect IDEs to grok. Python LLDB's API to say<span class="gmail-m6720070647917843543apple-converted-space"> </span><a href="https://microsoft.github.io/debug-adapter-protocol/" target="_blank">Microsoft's
Debug Adaptor Protocol</a> makes sense, and <a href="https://github.com/vadimcn/vscode-lldb/blob/v1.3.0/MANUAL.md" target="_blank">https://github.com/vadimcn/vscode-lldb/blob/v1.3.0/MANUAL.md</a> seems to get pretty close to that. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p> </o:p></span></p>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">[Adding Greg to the conversation]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">What's the relation between that project and <a href="https://github.com/llvm/llvm-project/tree/master/lldb/tools/lldb-vscode?" target="_blank">https://github.com/llvm/llvm-project/tree/master/lldb/tools/lldb-vscode?</a> From the comments
it looks like this is actually implementing the Debug Adaptor Protocol?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- adrian<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><br>
>> ><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>> > A question: what ever became of the effort to port the Emacs gdb-mi to lldb?<span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
>> We recently removed lldb-mi from the LLDB repository because nobody in the community was willing to maintain it. In particular the tests were so unreliable that most bots disabled them wholesale because they were so noisy. We had a GSoC student a year ago
who was able to rewrite many of the tests in a more reliable fashion, but there were still a lot of issues outstanding after the project was completed. If you are interested in picking this up, it may be worthwhile to think about implementing lldb-mi 2.0 as
thin python layer using the python SBAPI. Python may be a better choice for the kind of text-heavy glue-code that lldb-mi is. Alternatively it also shouldn't be hard at all to revive the existing C++ code. It's written in a different style than most of LLDB
or LLVM (and IMO it should have never been accepted upstream in this form), but it shouldn't be hard to get building since it (thanks to the GSoC project!) is using only the stable public SBAPI.<br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
><span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
> The great thing about standards is that there are so many to choose from! <span class="gmail-m6720070647917843543apple-converted-space"> </span><br>
<br>
It sounds like you are very much invested in realgud, but if anyone else is reading this and interested in taking up maintainership for lldb-mi, I think we'd be happy to welcome it back in tree as long as it is 100% reliably(!) tested and maintained.<o:p></o:p></span></p>
</blockquote>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">Or since we are soliciting help, I'd rather see something that goes to the Microsoft Debug Adaptor Protocol if vscode-lldb doesn't fit that already. It might even just be
repackaging parts of that code so that it can present itself that way. In the long term I don't see either gdb-mi and lldb-mi as viable solution that is going to reduce effort across different IDE's like the Microsoft Debug Adaptor Protocol could/does.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><o:p> </o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><br>
-- adrian<o:p></o:p></span></p>
</blockquote>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>