summaryrefslogtreecommitdiff
path: root/DevTools/ProfileViewer
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-11 23:37:11 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-11 23:37:11 +0200
commit8aab8faf305c8e9ba2883232e30f27822feb4ba5 (patch)
tree6cbd2f6c917b3edce4750184e72982f3eea5aa38 /DevTools/ProfileViewer
parent34d07e35bd0785f95f510876e02f33bb294f9219 (diff)
downloadserenity-8aab8faf305c8e9ba2883232e30f27822feb4ba5.zip
ProfileViewer: Open /boot/kernel for disassembly if possible
If you have access to /boot/kernel, you can see the disassembly of kernel code in ProfileViewer. This is really useful! :^)
Diffstat (limited to 'DevTools/ProfileViewer')
-rw-r--r--DevTools/ProfileViewer/DisassemblyModel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/DevTools/ProfileViewer/DisassemblyModel.cpp b/DevTools/ProfileViewer/DisassemblyModel.cpp
index 52f6552a73..e2ca4028c5 100644
--- a/DevTools/ProfileViewer/DisassemblyModel.cpp
+++ b/DevTools/ProfileViewer/DisassemblyModel.cpp
@@ -54,7 +54,12 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
: m_profile(profile)
, m_node(node)
{
- m_file = make<MappedFile>(profile.executable_path());
+ String path;
+ if (m_node.address() >= 0xc0000000)
+ path = "/boot/kernel";
+ else
+ path = profile.executable_path();
+ m_file = make<MappedFile>(path);
if (!m_file->is_valid())
return;