================ @@ -318,6 +318,32 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data, return error; } +static struct compat_timeval +copy_timespecs(const ProcessInstanceInfo::timespec &oth) { + using sec_t = decltype(compat_timeval::tv_sec); + using usec_t = decltype(compat_timeval::tv_usec); + return {static_cast<sec_t>(oth.tv_sec), static_cast<usec_t>(oth.tv_usec)}; +} + +std::optional<ELFLinuxPrStatus> +ELFLinuxPrStatus::Populate(const lldb::ThreadSP &thread_sp) { ---------------- feg208 wrote:
yes we should. In linux (and I guess in FreeBSD as well) a prstatus object is created for each thread which you can see in ProcessELFCore ``` 904 case ELF::NT_PRSTATUS: { 905 have_prstatus = true; 906 ELFLinuxPrStatus prstatus; 907 Status status = prstatus.Parse(note.data, arch); 908 if (status.Fail()) 909 return status.ToError(); 910 thread_data.prstatus_sig = prstatus.pr_cursig; 911 thread_data.tid = prstatus.pr_pid; 912 uint32_t header_size = ELFLinuxPrStatus::GetSize(arch); 913 size_t len = note.data.GetByteSize() - header_size; 914 thread_data.gpregset = DataExtractor(note.data, header_size, len); 915 break; ``` The tid is the pid. So in SaveCore we'll need to iterate over all the threads to build each struct. https://github.com/llvm/llvm-project/pull/104109 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits