Преглед изворни кода

Kernel+LibELF: Store termination signal in coredump ProcessInfo

Linus Groh пре 4 година
родитељ
комит
0571a17f57
3 измењених фајлова са 4 додато и 0 уклоњено
  1. 1 0
      Kernel/CoreDump.cpp
  2. 2 0
      Kernel/Process.h
  3. 1 0
      Libraries/LibELF/CoreDump.h

+ 1 - 0
Kernel/CoreDump.cpp

@@ -216,6 +216,7 @@ ByteBuffer CoreDump::create_notes_process_data() const
     ELF::Core::ProcessInfo info {};
     info.header.type = ELF::Core::NotesEntryHeader::Type::ProcessInfo;
     info.pid = m_process->pid().value();
+    info.termination_signal = m_process->termination_signal();
 
     process_data.append((void*)&info, sizeof(info));
 

+ 2 - 0
Kernel/Process.h

@@ -449,6 +449,8 @@ public:
     void terminate_due_to_signal(u8 signal);
     KResult send_signal(u8 signal, Process* sender);
 
+    u8 termination_signal() const { return m_termination_signal; }
+
     u16 thread_count() const
     {
         return m_thread_count.load(AK::MemoryOrder::memory_order_relaxed);

+ 1 - 0
Libraries/LibELF/CoreDump.h

@@ -51,6 +51,7 @@ struct [[gnu::packed]] NotesEntry {
 struct [[gnu::packed]] ProcessInfo {
     NotesEntryHeader header;
     int pid;
+    u8 termination_signal;
     char executable_path[]; // Null terminated
 };