mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
AK: Clean up backtraces
This commit replaces the default backtrace logic with cpptrace, for nicer, colored backtraces. Cpptrace runs on all of our supported platforms excpet android. As such backtrace.h is left in place. All the backtrace functions are made noinline to have a consistent number of frames. A maximum depth parameter is added to dump_backtrace with a default of 100. This should be enough, and can be easily changed, and allows for limiting the maximum depth. Setting the LADYBIRD_BACKTRACE_SNIPPETS environment variable enables surrouding code snippets in the backtrace. Specifically 2 lines above and below. This number can be changed by calling snippet_context on the formatter. For the whole list of options of what can be done with formatting see the cpptrace repository. On Windows we skipped frames when verification fails and when dump_backtrace was added the logic was wrong and would have skipped frames we care about. This commit also implements skipping frames on Linux. The only time where this does not skip all frames is when the call to backtrace gets intercepted. Then we will end up skipping one frame less than needed. To keep delayload on Windows a patch and overlay port is used. When upstream accepts these changes and vcpkg bumps the version the patch could be removed to have just the cmake define.
This commit is contained in:
Notes:
github-actions[bot]
2025-10-08 05:09:20 +00:00
Author: https://github.com/R-Goc Commit: https://github.com/LadybirdBrowser/ladybird/commit/3c7bad32cd6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5225 Reviewed-by: https://github.com/gmta
@@ -12,6 +12,10 @@
|
||||
"name": "angle",
|
||||
"platform": "linux | windows | android | freebsd"
|
||||
},
|
||||
{
|
||||
"name": "cpptrace",
|
||||
"platform": "linux | windows | freebsd | osx"
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
|
||||
Reference in New Issue
Block a user