1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

Kernel/SMP: Skip thread registers in core dump if there is no trap frame

We can only get thread registers if there's a trap frame.
This commit is contained in:
Andreas Kling 2021-08-10 01:19:23 +02:00
parent 9babb92a4b
commit 364134ad4b
2 changed files with 4 additions and 1 deletions

View file

@ -242,7 +242,9 @@ ByteBuffer CoreDump::create_notes_threads_data() const
ELF::Core::ThreadInfo info {};
info.header.type = ELF::Core::NotesEntryHeader::Type::ThreadInfo;
info.tid = thread.tid().value();
copy_kernel_registers_into_ptrace_registers(info.regs, thread.get_register_dump_from_stack());
if (thread.current_trap())
copy_kernel_registers_into_ptrace_registers(info.regs, thread.get_register_dump_from_stack());
entry_buff.append((void*)&info, sizeof(info));