This is an archive of the discontinued LLVM Phabricator instance.

Fix exception description in lldb-vscode
ClosedPublic

Authored by yinghuitan on Oct 19 2022, 2:46 PM.

Details

Summary

There is a bug in lldb-vscode that only shows stop reason ("exception") in
stopped event without showing the stop description of thrown exception. This
causes VSCode UI to only show "Paused on Exception" general message in
callstack window UI.

This patch fixes the bug so that VSCode callstack will show the detailed
exceptioni description, like "signal SIGABRT" or "EXC_BAD_ACCESS..." which
aligns with command line lldb experience.

I use C++ exception in testcase because the hardware exception description is
platform dependent and hard to verify.

Diff Detail

Event Timeline

yinghuitan created this revision.Oct 19 2022, 2:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 2:46 PM
yinghuitan requested review of this revision.Oct 19 2022, 2:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2022, 2:46 PM

If you're explicitly checking for SIGABRT, then you might as well raise that signal directly (raise(SIGABRT)) instead of relying on the runtime to do it (in response to an unhandled exception). Or, if you want this to work on windows, then you'll need to adjust the expectation for the fact that this will be reported differently there (I don't know how, but it will definitely not be SIGABRT).

Directly raise signal.

Fix comment

clayborg accepted this revision.Oct 24 2022, 3:42 PM
This revision is now accepted and ready to land.Oct 24 2022, 3:42 PM
This revision was automatically updated to reflect the committed changes.