[Lldb-commits] [lldb] [lldb] Add Populate Methods for ELFLinuxPrPsInfo and ELFLinuxPrStatus (PR #104109)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 14 23:28:13 PDT 2024


================
@@ -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) {
----------------
clayborg wrote:

Should be be using a `thread_sp` to populate process info? We would need to ensure we call this with the main thread only right? Can we just pass in a ProcessSP instead so there can be no error? 

https://github.com/llvm/llvm-project/pull/104109


More information about the lldb-commits mailing list