-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8367149: Add ergonomic construction for creating ad-hoc VMErrorCallback #27159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back aboldtch! A progress list of the required criteria for merging this PR into |
@xmas92 This change is no longer ready for integration - check the PR body for details. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments/suggestions on the doc.
// Sometimes doing a thing will crash the VM. | ||
do_a_thing(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// When VM crashes, the above lambda will be invoked and print relevant info.
might_cause_vm_crash();
@@ -251,4 +251,41 @@ class VMErrorCallbackMark : public StackObj { | |||
~VMErrorCallbackMark(); | |||
}; | |||
|
|||
// Ergonomic construction for creating ad-hoc VMErrorCallback which automatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Ergonomic construction
have specific meanings in cpp/this context? If not, I wonder if lightweight
is clearer, as it is less technical.
Add a class OnVMError which uses the VMErrorCallback mechanism which is an ergonomic construction for creating ad-hoc VMErrorCallback which automatically calls the provided invocable f if a VM crash occurs within its lifetime. Can be used to instrument a build for more detailed contextual information gathering. Especially useful when hunting down intermittent bugs, or issues only reproducible in environments where access to a debugger is not readily available. Example use:
C++17 class template argument deduction finally makes these sort of constructions ergonomic to use without the need for auto and helper construction methods.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27159/head:pull/27159
$ git checkout pull/27159
Update a local copy of the PR:
$ git checkout pull/27159
$ git pull https://git.openjdk.org/jdk.git pull/27159/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27159
View PR using the GUI difftool:
$ git pr show -t 27159
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27159.diff
Using Webrev
Link to Webrev Comment