[Lldb-commits] [PATCH] D59114: [lldb-vscode] Don't hang indefinitely on invalid program

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 7 14:57:16 PST 2019


zturner created this revision.
zturner added a reviewer: clayborg.

When you configure your launch settings, if you pass a path to an invalid program, we would previously hand indefinitely.  This is because a combination of two bugs working together.  The first is that we did not attempt to detect when handling the request whether the file existed, and we would just pass it through to the `Process::Launch` method.  The second is that the `Process::Launch` method did not properly report an error in the case where the file does not exist.  It actually reported that the launch succeeded, which would then cause LLDB to wait on the broadcaster to receive some events, which would obviously never come.

Although fixing this in either place independently will get lldb-vscode working properly when an invalid executable is specified, I'm fixing it in both places because it seems like the right thing to do.  Note that for the first fix (the one in `lldb-vscode.cpp`) we were previously checking the value of `error.Fail()`, but the previous call did not actually communicate an error via an `SBError` return, instead it communicated an error via a null `SBModule` return.  So this condition is changed.


https://reviews.llvm.org/D59114

Files:
  lldb/source/Target/Process.cpp
  lldb/tools/lldb-vscode/lldb-vscode.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59114.189788.patch
Type: text/x-patch
Size: 10065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190307/ac1d3a40/attachment.bin>


More information about the lldb-commits mailing list