Skip to content

Commit 8d93c8d

Browse files
committed
Auto merge of rust-lang#130846 - ChrisDenton:revert-break, r=Noratrieb
Revert Break into the debugger on panic (129019) This was talked about a bit at a recent libs meeting. While I think experimenting with this is worthwhile, I am nervous about this new behaviour reaching stable. We've already reverted on one tier 1 platform (Linux, rust-lang#130810) which means we have differing semantics on different tier 1 platforms. Also the fact it triggers even when `catch_unwind` is used to catch the panic means it can be very noisy in some projects. At the very least I think it could use some more discussion before being instantly stable. I think this could maybe be re-landed with an environment variable to control/override the behaviour. But that part would likely need a libs-api decision. cc `@workingjubilee` `@kromych`
2 parents 76ed7a1 + d3e59a5 commit 8d93c8d

File tree

3 files changed

+1
-170
lines changed

3 files changed

+1
-170
lines changed

library/std/src/panicking.rs

+1-17
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use crate::mem::{self, ManuallyDrop};
2323
use crate::panic::{BacktraceStyle, PanicHookInfo};
2424
use crate::sync::atomic::{AtomicBool, Ordering};
2525
use crate::sync::{PoisonError, RwLock};
26+
use crate::sys::backtrace;
2627
use crate::sys::stdio::panic_output;
27-
use crate::sys::{backtrace, dbg};
2828
use crate::{fmt, intrinsics, process, thread};
2929

3030
// Binary interface to the panic runtime that the standard library depends on.
@@ -859,29 +859,13 @@ pub fn rust_panic_without_hook(payload: Box<dyn Any + Send>) -> ! {
859859
#[cfg_attr(not(test), rustc_std_internal_symbol)]
860860
#[cfg(not(feature = "panic_immediate_abort"))]
861861
fn rust_panic(msg: &mut dyn PanicPayload) -> ! {
862-
// Break into the debugger if it is attached.
863-
// The return value is not currently used.
864-
//
865-
// This function isn't used anywhere else, and
866-
// using inside `#[panic_handler]` doesn't seem
867-
// to count, so a warning is issued.
868-
let _ = dbg::breakpoint_if_debugging();
869-
870862
let code = unsafe { __rust_start_panic(msg) };
871863
rtabort!("failed to initiate panic, error {code}")
872864
}
873865

874866
#[cfg_attr(not(test), rustc_std_internal_symbol)]
875867
#[cfg(feature = "panic_immediate_abort")]
876868
fn rust_panic(_: &mut dyn PanicPayload) -> ! {
877-
// Break into the debugger if it is attached.
878-
// The return value is not currently used.
879-
//
880-
// This function isn't used anywhere else, and
881-
// using inside `#[panic_handler]` doesn't seem
882-
// to count, so a warning is issued.
883-
let _ = dbg::breakpoint_if_debugging();
884-
885869
unsafe {
886870
crate::intrinsics::abort();
887871
}

library/std/src/sys/dbg.rs

-152
This file was deleted.

library/std/src/sys/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ mod personality;
1111
pub mod anonymous_pipe;
1212
pub mod backtrace;
1313
pub mod cmath;
14-
pub mod dbg;
1514
pub mod exit_guard;
1615
pub mod os_str;
1716
pub mod path;

0 commit comments

Comments
 (0)