<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 12, 2019, at 4:45 PM, Rocky Bernstein <<a href="mailto:rb@dustyfeet.com" class="">rb@dustyfeet.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div dir="ltr" class="gmail_attr">On Thu, Sep 12, 2019 at 5:51 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class=""><br class="">> On Sep 12, 2019, at 2:24 PM, Rocky Bernstein <<a href="mailto:rb@dustyfeet.com" target="_blank" class="">rb@dustyfeet.com</a>> wrote:<br class="">><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">> On Thu, Sep 12, 2019 at 3:37 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>> wrote:<br class="">>><span class="Apple-converted-space"> </span><br class="">>> > On Sep 11, 2019, at 1:08 AM, Rocky Bernstein via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class="">>> ><span class="Apple-converted-space"> </span><br class="">>> ><span class="Apple-converted-space"> </span><br class="">>> > Hi - I just wanted to mention that if there are emacs users there is an interface to lldb via realgud. See<span class="Apple-converted-space"> </span><a href="https://github.com/realgud/realgud-lldb" rel="noreferrer" target="_blank" class="">https://github.com/realgud/realgud-lldb</a><br class="">>> ><span class="Apple-converted-space"> </span><br class="">>> > A MELPA package and ELPA packageElpa package are available too<span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><br class="">>> 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" rel="noreferrer" target="_blank" class="">https://opensource.apple.com/source/lldb/lldb-69/utils/emacs/gud.el.auto.html</a>)<br class="">><span class="Apple-converted-space"> </span><br class="">> "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 class=""><br class="">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 class=""><br class="">> Adapted from<span class="Apple-converted-space"> </span><a href="https://github.com/realgud/realgud/blob/master/realgud.el" rel="noreferrer" target="_blank" class="">https://github.com/realgud/realgud/blob/master/realgud.el</a><br class="">><span class="Apple-converted-space"> </span><br class="">>> 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 class="">>> Oh, and because global variables are largely banned, we can support several simultaneous debug sessions.<br class=""><br class="">> 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="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">> 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="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">> 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 class=""><br class="">Thanks for explaining the differences!<br class=""><br class="">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.<br class=""></blockquote><div class=""><br class=""></div><div class="">Yes, it scrapes console output and that is a problem. A big problem.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">However as is in its current state, this isn't going to cut it because Emacs uses its own Lisp, not Python.</div><div class=""><br class=""></div><div class="">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="Apple-converted-space"> </span><a href="https://microsoft.github.io/debug-adapter-protocol/" class="">Microsoft's Debug Adaptor Protocol</a> makes sense, and <a href="https://github.com/vadimcn/vscode-lldb/blob/v1.3.0/MANUAL.md" class="">https://github.com/vadimcn/vscode-lldb/blob/v1.3.0/MANUAL.md</a> seems to get pretty close to that. </div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>[Adding Greg to the conversation]</div><div><br class=""></div><div>What's the relation between that project and <a href="https://github.com/llvm/llvm-project/tree/master/lldb/tools/lldb-vscode?" class="">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?</div><div><br class=""></div><div>-- adrian</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class="">>> ><span class="Apple-converted-space"> </span><br class="">>> > A question: what ever became of the effort to port the Emacs gdb-mi to lldb?<span class="Apple-converted-space"> </span><br class="">>><span class="Apple-converted-space"> </span><br class="">>> 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 class="">><span class="Apple-converted-space"> </span><br class="">><span class="Apple-converted-space"> </span><br class="">> The great thing about standards is that there are so many to choose from! <span class="Apple-converted-space"> </span><br class=""><br class="">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.<br class=""></blockquote><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class="">-- adrian</blockquote></div></div></blockquote></div><br class=""></body></html>