<div dir="ltr"><div dir="ltr"><br class="gmail-Apple-interchange-newline"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 12, 2019 at 3:37 PM Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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>
> <br>
> <br>
> Hi - I just wanted to mention that if there are emacs users there is an interface to lldb via realgud. See <a href="https://github.com/realgud/realgud-lldb" rel="noreferrer" target="_blank">https://github.com/realgud/realgud-lldb</a><br>
> <br>
> A MELPA package and ELPA packageElpa package are available too <br>
<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" rel="noreferrer" target="_blank">https://opensource.apple.com/source/lldb/lldb-69/utils/emacs/gud.el.auto.html</a>)<br></blockquote><div><br></div><div>"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.)</div><div><br></div><div><br></div><div>Adapted from <a href="https://github.com/realgud/realgud/blob/master/realgud.el">https://github.com/realgud/realgud/blob/master/realgud.el</a></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.<table class="gmail-highlight gmail-tab-size gmail-js-file-line-container" style="box-sizing:border-box;border-spacing:0px;border-collapse:collapse;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"><td id="gmail-L51" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;line-height:20px;color:rgba(27,31,35,0.3);text-align:right;white-space:nowrap;vertical-align:top"></td></tr></tbody></table></blockquote><div><br></div><div>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. </div><div><br></div><div>gud has always been a bit too monolithic - it contains every debugger (including some obsolete ones - does anyone really still use <a href="https://en.wikipedia.org/wiki/Dbx_(debugger)">dbx</a>, 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. </div><div><br></div><div>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 <a href="https://elpa.gnu.org/packages/load-relative.html">"require" package </a>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> <br>
> A question: what ever became of the effort to port the Emacs gdb-mi to lldb? <br>
<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></blockquote><div><br></div><div><br></div><div>The great thing about standards is that there are so many to choose from!  </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- adrian</blockquote></div></div>