1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 09:07:35 +00:00

Kernel: Make Processor::capture_stack_trace fallible using ErrorOr

This commit is contained in:
Idan Horowitz 2022-01-15 21:19:16 +02:00
parent 03b7352286
commit 0142f33ddc
4 changed files with 15 additions and 12 deletions

View file

@ -27,7 +27,7 @@ ErrorOr<void> Process::procfs_get_thread_stack(ThreadID thread_id, KBufferBuilde
return ESRCH;
bool show_kernel_addresses = Process::current().is_superuser();
bool kernel_address_added = false;
for (auto address : Processor::capture_stack_trace(*thread, 1024)) {
for (auto address : TRY(Processor::capture_stack_trace(*thread, 1024))) {
if (!show_kernel_addresses && !Memory::is_user_address(VirtualAddress { address })) {
if (kernel_address_added)
continue;