summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2021-06-11 14:39:16 +0300
committerAndreas Kling <kling@serenityos.org>2021-06-19 14:51:18 +0200
commit03ef2a479a121cef5de5ca33792f4cf997e6ee71 (patch)
treec3c713e2c3fb62aa0545e315d71ca840108f9e24 /Userland/Services
parenta45b5ccd969443aef7a4afce8bd43d512ca74b1a (diff)
downloadserenity-03ef2a479a121cef5de5ca33792f4cf997e6ee71.zip
LibCoreDump: Include source locations of inlined functions in backtrace
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/CrashDaemon/main.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Userland/Services/CrashDaemon/main.cpp b/Userland/Services/CrashDaemon/main.cpp
index 5f6ea14fdf..c8b314b10e 100644
--- a/Userland/Services/CrashDaemon/main.cpp
+++ b/Userland/Services/CrashDaemon/main.cpp
@@ -74,8 +74,20 @@ static void print_backtrace(const String& coredump_path)
if (thread_index > 0)
dbgln();
dbgln("--- Backtrace for thread #{} (TID {}) ---", thread_index, thread_info.tid);
- for (auto& entry : backtrace.entries())
+ for (auto& entry : backtrace.entries()) {
+#ifndef BACKTRACE_DEBUG
dbgln("{}", entry.to_string(true));
+#else
+ auto region = coredump->region_containing(entry.eip);
+ String name;
+ u32 base_addr { 0 };
+ if (region) {
+ name = region->region_name;
+ base_addr = region->region_start;
+ }
+ dbgln("{} ({} base: {:p}, offset: {:p})", entry.to_string(true), name, base_addr, entry.eip - base_addr);
+#endif
+ }
++thread_index;
return IterationDecision::Continue;
});