<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The solution I would love to see is to have the initialize packet return something via the DAP that says "I have a command line interpreter, please send a packet with a file handle (slave path to slave side of pseudo terminal maybe)". VS Code and Nuclide both emulated tty already, so we could have a true command line that exposes the "(gdb)" prompt for GDB and "(lldb)" for lldb and all the power that comes with it. </span>

<br></blockquote><div><br></div><div>I agree, that's the main reason I asked. Having a per-DAP convention seems unfortunate. Also, with the current DAP messages it doesn't seem we can do things like auto-complete or passing control characters to the debugger first (ex Ctrl-C).</div><div><br></div><div>I like your idea to manage an extra file handle. What if DAP offered "console stream" packets? Yet another option would be going around DAP completely for the pseudo terminal functionality, although it would be nice if everything can be built on top of DAP.</div><div><br></div><div>Not urgent but perhaps we can use LLDB to design and prototype such a DAP extension, then propose it to the vscode team? Is this something you'd be interested in?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 21, 2018 at 9:56 AM, Greg Clayton <span dir="ltr"><<a href="mailto:clayborg@gmail.com" target="_blank">clayborg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br><div><span class=""><br><blockquote type="cite"><div>On Sep 20, 2018, at 3:05 PM, Leonard Mosescu <<a href="mailto:mosescu@google.com" target="_blank">mosescu@google.com</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr">Hi Greg, looking at request_evaluate() I noticed that it will evaluate the string as a lldb command if prefixed by ` . </div><div dir="ltr"><br></div><div dir="ltr">This is a great feature (it allows building REPL consoles on top of DAP), but I'm curious how you picked up this convention? For example I believe that the gdb DAP uses -exec 'command' instead.</div></div></div></blockquote><div><br></div></span>` is an illegal expression character so it won't stop you from evaluating any possible expression. The gdb prefix "-exec" stops you from being able to negate a local variable named "exec". Not a huge deal.  So I just picked a good prefix character that wouldn't stop anyone from evaluating any valid expression (at least in C/C++/ObjC/Swift).</div><div><br></div><div>The solution I would love to see is to have the initialize packet return something via the DAP that says "I have a command line interpreter, please send a packet with a file handle (slave path to slave side of pseudo terminal maybe)". VS Code and Nuclide both emulated tty already, so we could have a true command line that exposes the "(gdb)" prompt for GDB and "(lldb)" for lldb and all the power that comes with it. </div><div><br></div><div>I needed something that could run LLDB commands when things go wrong to do trouble shooting (enable logging, run commands to dump vital information) so I hacked it in with `</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Greg</div></font></span><div><div class="h5"><div><br></div><div><blockquote type="cite"><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 16, 2018 at 11:01 AM, Phabricator via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL339911: Add a new tool named &quot;lldb-vscode&quot; that implements the Visual Studio Code Debug… (authored by gclayton, committed by ).<br>
Herald added a subscriber: llvm-commits.<br>
<br>
Changed prior to commit:<br>
  <a href="https://reviews.llvm.org/D50365?vs=161058&id=161067#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/D5036<wbr>5?vs=161058&id=161067#toc</a><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D50365" rel="noreferrer" target="_blank">https://reviews.llvm.org/D5036<wbr>5</a><br>
<br>
Files:<br>
  lldb/trunk/lldb.xcodeproj/proj<wbr>ect.pbxproj<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/dotest.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/lldbtest.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>.categories<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>attach/Makefile<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>attach/TestVSCode_attach.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>attach/main.c<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>breakpoint/Makefile<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>breakpoint/TestVSCode_setBreak<wbr>points.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>breakpoint/TestVSCode_setExcep<wbr>tionBreakpoints.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>breakpoint/TestVSCode_setFunct<wbr>ionBreakpoints.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>breakpoint/main.cpp<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>launch/Makefile<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>launch/TestVSCode_launch.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>launch/main.c<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>lldbvscode_testcase.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>stackTrace/Makefile<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>stackTrace/TestVSCode_stackTra<wbr>ce.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>stackTrace/main.c<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>step/Makefile<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>step/TestVSCode_step.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>step/main.cpp<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>variables/Makefile<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>variables/TestVSCode_variables<wbr>.py<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>variables/main.cpp<br>
  lldb/trunk/packages/Python/lld<wbr>bsuite/test/tools/lldb-vscode/<wbr>vscode.py<br>
  lldb/trunk/tools/CMakeLists.tx<wbr>t<br>
  lldb/trunk/tools/lldb-vscode/B<wbr>reakpointBase.cpp<br>
  lldb/trunk/tools/lldb-vscode/B<wbr>reakpointBase.h<br>
  lldb/trunk/tools/lldb-vscode/C<wbr>MakeLists.txt<br>
  lldb/trunk/tools/lldb-vscode/E<wbr>xceptionBreakpoint.cpp<br>
  lldb/trunk/tools/lldb-vscode/E<wbr>xceptionBreakpoint.h<br>
  lldb/trunk/tools/lldb-vscode/F<wbr>unctionBreakpoint.cpp<br>
  lldb/trunk/tools/lldb-vscode/F<wbr>unctionBreakpoint.h<br>
  lldb/trunk/tools/lldb-vscode/J<wbr>SONUtils.cpp<br>
  lldb/trunk/tools/lldb-vscode/J<wbr>SONUtils.h<br>
  lldb/trunk/tools/lldb-vscode/L<wbr>LDBUtils.cpp<br>
  lldb/trunk/tools/lldb-vscode/L<wbr>LDBUtils.h<br>
  lldb/trunk/tools/lldb-vscode/R<wbr>EADME.md<br>
  lldb/trunk/tools/lldb-vscode/S<wbr>ourceBreakpoint.cpp<br>
  lldb/trunk/tools/lldb-vscode/S<wbr>ourceBreakpoint.h<br>
  lldb/trunk/tools/lldb-vscode/S<wbr>ourceReference.h<br>
  lldb/trunk/tools/lldb-vscode/V<wbr>SCode.cpp<br>
  lldb/trunk/tools/lldb-vscode/V<wbr>SCode.h<br>
  lldb/trunk/tools/lldb-vscode/V<wbr>SCodeForward.h<br>
  lldb/trunk/tools/lldb-vscode/l<wbr>ldb-vscode-Info.plist<br>
  lldb/trunk/tools/lldb-vscode/l<wbr>ldb-vscode.cpp<br>
  lldb/trunk/tools/lldb-vscode/p<wbr>ackage.json<br>
<br>
</blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></blockquote></div><br></div>