Skip to content
Commit 9a3f0cd7 authored by Tom Yang's avatar Tom Yang
Browse files

Fix crash in lldb-vscode when missing function name

Summary:
In cases where the PC has no function name, lldb-vscode crashes.

`lldb::SBFrame::GetDisplayFunctionName()` returns a `nullptr`, and when we
attempt to construct an `std::string`, it raises an exception.

Test plan:
This can be observed with creating a test file (credit to @clayborg for
the example):
```
int main() {
  typedef void (*FooCallback)();
  FooCallback foo_callback = (FooCallback)0;
  foo_callback(); // Crash at zero!
  return 0;
}
```
and attempting to debug the file through VSCode.

I add a test case in D156732 which should cover this.

Differential Revision: https://reviews.llvm.org/D156970
parent 6537181d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment