summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Services/SymbolServer/main.cpp8
-rw-r--r--Userland/Utilities/bt.cpp13
2 files changed, 19 insertions, 2 deletions
diff --git a/Userland/Services/SymbolServer/main.cpp b/Userland/Services/SymbolServer/main.cpp
index 8d6e1a2f45..f975f3b37b 100644
--- a/Userland/Services/SymbolServer/main.cpp
+++ b/Userland/Services/SymbolServer/main.cpp
@@ -49,6 +49,14 @@ int main(int, char**)
return 1;
}
+ // NOTE: Developers can opt into kernel symbolication by making /boot/Kernel accessible to the "symbol" user.
+ if (access("/boot/Kernel", F_OK) == 0) {
+ if (unveil("/boot/Kernel", "r") < 0) {
+ perror("unveil");
+ return 1;
+ }
+ }
+
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
diff --git a/Userland/Utilities/bt.cpp b/Userland/Utilities/bt.cpp
index ba0e906cff..55fbbd6921 100644
--- a/Userland/Utilities/bt.cpp
+++ b/Userland/Utilities/bt.cpp
@@ -70,11 +70,18 @@ int main(int argc, char** argv)
FlatPtr base { 0 };
size_t size { 0 };
String path;
+ bool is_relative { true };
};
Vector<FlatPtr> stack;
Vector<RegionWithSymbols> regions;
+ regions.append(RegionWithSymbols {
+ .base = 0xc0000000,
+ .size = 0x3fffffff,
+ .path = "/boot/Kernel",
+ .is_relative = false });
+
{
// FIXME: Support multiple threads in the same process!
auto stack_path = String::formatted("/proc/{}/stacks/{}", pid, pid);
@@ -141,7 +148,6 @@ int main(int argc, char** argv)
auto client = SymbolClient::Client::construct();
for (auto address : stack) {
-
const RegionWithSymbols* found_region = nullptr;
for (auto& region : regions) {
if (address >= region.base && address < (region.base + region.size)) {
@@ -156,7 +162,10 @@ int main(int argc, char** argv)
}
Vector<FlatPtr> addresses;
- addresses.append(address - found_region->base);
+ if (found_region->is_relative)
+ addresses.append(address - found_region->base);
+ else
+ addresses.append(address);
auto symbols = client->symbolicate(found_region->path, addresses);
if (symbols.is_empty()) {