ladybird/Userland/Libraries/LibSymbolication/Symbolication.h
Gunnar Beutner 60d6137e73 Userland: Use /proc/kernel_base to determine the kernel base address
This removes all the hard-coded kernel base addresses from userspace
tools.

One downside for this is that e.g. Profiler no longer uses a different
color for kernel symbols when run as a non-root user.
2021-07-22 21:38:23 +02:00

25 lines
521 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <LibDebug/DebugInfo.h>
namespace Symbolication {
struct Symbol {
FlatPtr address { 0 };
String name {};
u32 offset { 0 };
Vector<Debug::DebugInfo::SourcePosition> source_positions;
};
Optional<FlatPtr> kernel_base();
Vector<Symbol> symbolicate_thread(pid_t pid, pid_t tid);
Optional<Symbol> symbolicate(String const& path, FlatPtr address);
}