Skip to content
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

LSP: Submit the full backtrace to the crash reporter #7323

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

ogoffart
Copy link
Member

No description provided.

@ogoffart ogoffart requested review from tronical and hunger January 10, 2025 14:13
@@ -245,6 +245,7 @@ fn main() {
} else {
writeln!(file, "unknown location")
};
let _ = writeln!(file, "{:?}", std::backtrace::Backtrace::force_capture());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is multiple lines, how come const backtrace = lines[2]; works on the TypeScript side?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a single line. Looks like this:

Backtrace [{ fn: "slint_lsp::main::{{closure}}", file: "<REDACTED: user-file-path>", line: 248 }, { fn: "<alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call", file: "<REDACTED: user-file-path>", line: 2245 }, { fn: "std::panicking::rust_panic_with_hook", file: "<REDACTED: user-file-path>", line: 805 }, { fn: "std::panicking::begin_panic_handler::{{closure}}", file: "<REDACTED: user-file-path>", line: 671 }, { fn: "std::sys::backtrace::__rust_end_short_backtrace", file: "<REDACTED: user-file-path>", line: 170 }, { fn: "rust_begin_unwind", file: "<REDACTED: user-file-path>", line: 662 }, { fn: "core::panicking::panic_fmt", file: "<REDACTED: user-file-path>", line: 74 }, { fn: "slint_interpreter::dynamic_item_tree::instantiate::{{closure}}", file: "<REDACTED: user-file-path>", line: 1713 }, { fn: "i_slint_compiler::generator::handle_property_bindings_init::handle_property_inner", file: "<REDACTED: user-file-path>", line: 434 }]

Note that the "file", and "line" are going to be omited when the LSP is build in release.
You can see that there: https://play.rust-lang.org/?version=stable&mode=release&edition=2021&gist=a78149bd02864dcf20a843b4e270f0c7

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, makes sense. Thanks :)

@ogoffart ogoffart merged commit 57f42c0 into master Jan 10, 2025
37 checks passed
@ogoffart ogoffart deleted the olivier/lsp branch January 10, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants