mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
Kernel: Make /proc/PID/stacks/TID a JSON array
The contents of these files are now raw JSON arrays. We no longer symbolicate the addresses. That's up to userspace from now on.
This commit is contained in:
parent
6a00e338a8
commit
54d28df97d
Notes:
sideshowbarker
2024-07-18 22:35:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/54d28df97d8
1 changed files with 10 additions and 2 deletions
|
@ -615,8 +615,16 @@ static bool procfs$tid_stack(InodeIdentifier identifier, KBufferBuilder& builder
|
|||
auto thread = Thread::from_tid(to_tid(identifier));
|
||||
if (!thread)
|
||||
return false;
|
||||
builder.appendf("Thread %d (%s):\n", thread->tid().value(), thread->name().characters());
|
||||
builder.append(thread->backtrace());
|
||||
|
||||
JsonArraySerializer array { builder };
|
||||
bool show_kernel_addresses = Process::current()->is_superuser();
|
||||
for (auto address : Processor::capture_stack_trace(*thread, 1024)) {
|
||||
if (!show_kernel_addresses && !is_user_address(VirtualAddress { address }))
|
||||
address = 0xdeadc0de;
|
||||
array.add(JsonValue(address));
|
||||
}
|
||||
|
||||
array.finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue