This is an archive of the discontinued LLVM Phabricator instance.

Add runToBinaryEntry option for lldb-vscode
ClosedPublic

Authored by yinghuitan on Oct 12 2022, 10:51 AM.

Details

Summary

This patch adds a new runToBinaryEntry option which sets a one-shot breakpoint
at program entry. This option is useful for synchronizing module loading with
dynamic loader to measure debugger startup performance: when program entry
one-short breakpoint hits most of the dependency modules should have been
loaded so this provides a good sample point for debugger startup time.

More explicitly for lldb-vscode, when this option is enabled, "Initialized" DAP
event is synchronously sent after most dependency modules are loaded.

Diff Detail

Event Timeline

yinghuitan created this revision.Oct 12 2022, 10:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 10:51 AM
yinghuitan requested review of this revision.Oct 12 2022, 10:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 10:51 AM
clayborg accepted this revision.Oct 12 2022, 11:15 AM

Fix the comment as suggested and good to go. Also please test on both macOS and linux to ensure this works on both prior to pushing the diff, I often have issues on either side with lldb-vscode modifications.

lldb/tools/lldb-vscode/lldb-vscode.cpp
1647
This revision is now accepted and ready to land.Oct 12 2022, 11:15 AM
clayborg requested changes to this revision.Oct 12 2022, 11:16 AM

Woops, forgot, you will need to modify the package.json to document the new launch config options

This revision now requires changes to proceed.Oct 12 2022, 11:16 AM

Use async model.

Update message per feedback

GeorgeHuyubo accepted this revision.Nov 22 2022, 11:55 AM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 22 2022, 1:52 PM
This revision was automatically updated to reflect the committed changes.

Unfortunately, it looks like that patch broke things too. I haven't looked at the cause too closely, as the error was the same on linux and macos, but if you have problems reproducing it, let me know.

Ah, now I see that patch didn't land yet.

In the future, I think you can land simple changes like that without waiting for a (pre-commit) review, but if you don't feel comfortable doing that, then please revert the original patch so as to not leave the build in a broken state for a long period of time.