Add TestCrash action (#35088)

This triggers a crash that avoids our panic-handler, which is useful for
testing that our crash reporting works even when you don't get a panic.

Release Notes:

- N/A
This commit is contained in:
Julia Ryan 2025-07-25 07:40:26 -05:00 committed by GitHub
parent 57b463fd0d
commit 9071341a1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,6 +111,8 @@ actions!(
Zoom,
/// Triggers a test panic for debugging.
TestPanic,
/// Triggers a hard crash for debugging.
TestCrash,
]
);
@ -126,6 +128,14 @@ pub fn init(cx: &mut App) {
cx.on_action(|_: &RestoreBanner, cx| title_bar::restore_banner(cx));
if ReleaseChannel::global(cx) == ReleaseChannel::Dev || cx.has_flag::<PanicFeatureFlag>() {
cx.on_action(|_: &TestPanic, _| panic!("Ran the TestPanic action"));
cx.on_action(|_: &TestCrash, _| {
unsafe extern "C" {
fn puts(s: *const i8);
}
unsafe {
puts(0xabad1d3a as *const i8);
}
});
}
cx.on_action(|_: &OpenLog, cx| {
with_active_or_new_workspace(cx, |workspace, window, cx| {