diff options
-rw-r--r-- | Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp | 9 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/DisassemblyModel.cpp | 8 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/Profile.cpp | 11 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/ProfileModel.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibSymbolication/Symbolication.cpp | 5 | ||||
-rw-r--r-- | Userland/Utilities/bt.cpp | 8 |
6 files changed, 43 insertions, 6 deletions
diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp index 8c5909fe10..da6ae10f78 100644 --- a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp +++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp @@ -30,7 +30,14 @@ DisassemblyModel::DisassemblyModel(const Debug::DebugSession& debug_session, con OwnPtr<ELF::Image> kernel_elf; const ELF::Image* elf = nullptr; - if (containing_function.value().address_low >= 0xc0000000) { + // FIXME: Use /proc for this +#if ARCH(I386) + FlatPtr kernel_base = 0xc0000000; +#else + FlatPtr kernel_base = 0x2000000000; +#endif + + if (containing_function.value().address_low >= kernel_base) { auto file_or_error = MappedFile::map("/boot/Kernel.debug"); if (file_or_error.is_error()) return; diff --git a/Userland/DevTools/Profiler/DisassemblyModel.cpp b/Userland/DevTools/Profiler/DisassemblyModel.cpp index 7dd9b99502..20dc66237e 100644 --- a/Userland/DevTools/Profiler/DisassemblyModel.cpp +++ b/Userland/DevTools/Profiler/DisassemblyModel.cpp @@ -40,7 +40,13 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node) OwnPtr<ELF::Image> kernel_elf; const ELF::Image* elf; FlatPtr base_address = 0; - if (m_node.address() >= 0xc0000000) { + // FIXME: Use /proc for this +#if ARCH(I386) + FlatPtr kernel_base = 0xc0000000; +#else + FlatPtr kernel_base = 0x2000000000; +#endif + if (m_node.address() >= kernel_base) { if (!m_kernel_file) { auto file_or_error = MappedFile::map("/boot/Kernel.debug"); if (file_or_error.is_error()) diff --git a/Userland/DevTools/Profiler/Profile.cpp b/Userland/DevTools/Profiler/Profile.cpp index b16d319dc1..d66391ad8a 100644 --- a/Userland/DevTools/Profiler/Profile.cpp +++ b/Userland/DevTools/Profiler/Profile.cpp @@ -301,6 +301,13 @@ Result<NonnullOwnPtr<Profile>, String> Profile::load_from_perfcore_file(const St continue; } + // FIXME: Use /proc for this +#if ARCH(I386) + FlatPtr kernel_base = 0xc0000000; +#else + FlatPtr kernel_base = 0x2000000000; +#endif + auto* stack = perf_event.get_ptr("stack"); VERIFY(stack); auto& stack_array = stack->as_array(); @@ -311,7 +318,7 @@ Result<NonnullOwnPtr<Profile>, String> Profile::load_from_perfcore_file(const St FlyString object_name; String symbol; - if (ptr >= 0xc0000000) { + if (ptr >= kernel_base) { if (kernel_elf) { symbol = kernel_elf->symbolicate(ptr, &offset); } else { @@ -338,7 +345,7 @@ Result<NonnullOwnPtr<Profile>, String> Profile::load_from_perfcore_file(const St continue; FlatPtr innermost_frame_address = event.frames.at(1).address; - event.in_kernel = innermost_frame_address >= 0xc0000000; + event.in_kernel = innermost_frame_address >= kernel_base; events.append(move(event)); } diff --git a/Userland/DevTools/Profiler/ProfileModel.cpp b/Userland/DevTools/Profiler/ProfileModel.cpp index 055106f98b..abd791f4a9 100644 --- a/Userland/DevTools/Profiler/ProfileModel.cpp +++ b/Userland/DevTools/Profiler/ProfileModel.cpp @@ -105,7 +105,13 @@ GUI::Variant ProfileModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol if (node->is_root()) { return GUI::FileIconProvider::icon_for_executable(node->process().executable); } - if (node->address() >= 0xc0000000) + // FIXME: Use /proc for this +#if ARCH(I386) + FlatPtr kernel_base = 0xc0000000; +#else + FlatPtr kernel_base = 0x2000000000; +#endif + if (node->address() >= kernel_base) return m_kernel_frame_icon; return m_user_frame_icon; } diff --git a/Userland/Libraries/LibSymbolication/Symbolication.cpp b/Userland/Libraries/LibSymbolication/Symbolication.cpp index b0caa7749b..a879be3390 100644 --- a/Userland/Libraries/LibSymbolication/Symbolication.cpp +++ b/Userland/Libraries/LibSymbolication/Symbolication.cpp @@ -82,7 +82,12 @@ Vector<Symbol> symbolicate_thread(pid_t pid, pid_t tid) Vector<RegionWithSymbols> regions; regions.append(RegionWithSymbols { + // FIXME: Use /proc for this +#if ARCH(I386) .base = 0xc0000000, +#else + .base = 0x2000000000, +#endif .size = 0x3fffffff, .path = "/boot/Kernel.debug", .is_relative = false }); diff --git a/Userland/Utilities/bt.cpp b/Userland/Utilities/bt.cpp index c291894dbc..1963547f7c 100644 --- a/Userland/Utilities/bt.cpp +++ b/Userland/Utilities/bt.cpp @@ -44,7 +44,13 @@ int main(int argc, char** argv) auto frame_number = symbols.size() - 1; for (auto& symbol : symbols) { // Make kernel stack frames stand out. - int color = symbol.address < 0xc0000000 ? 35 : 31; + // FIXME: Use /proc for this +#if ARCH(I386) + FlatPtr kernel_base = 0xc0000000; +#else + FlatPtr kernel_base = 0x2000000000; +#endif + int color = symbol.address < kernel_base ? 35 : 31; out("{:3}: \033[{};1m{:p}\033[0m | ", frame_number, color, symbol.address); if (!symbol.name.is_empty()) out("{} ", symbol.name); |