[Lldb-commits] [lldb] [lldb] Add Populate Methods for ELFLinuxPrPsInfo and ELFLinuxPrStatus (PR #104109)
Fred Grim via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 16 06:30:24 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) {
+ ELFLinuxPrStatus prstatus{};
+ prstatus.pr_pid = thread_sp->GetID();
+ lldb::ProcessSP process_sp = thread_sp->GetProcess();
+ ProcessInstanceInfo info;
+ if (!process_sp->GetProcessInfo(info)) {
+ return std::nullopt;
+ }
----------------
feg208 wrote:
blech. You are right. Fixed. Sorry.
https://github.com/llvm/llvm-project/pull/104109
More information about the lldb-commits
mailing list