LLDB mainline
ELFLinuxPrPsInfo Struct Reference

#include <ThreadElfCore.h>

Public Member Functions

 ELFLinuxPrPsInfo ()
lldb_private::Status Parse (const lldb_private::DataExtractor &data, const lldb_private::ArchSpec &arch)

Static Public Member Functions

static std::optional< ELFLinuxPrPsInfoPopulate (const lldb::ProcessSP &process_sp)
static std::optional< ELFLinuxPrPsInfoPopulate (const lldb_private::ProcessInstanceInfo &info, lldb::StateType state)
static size_t GetSize (const lldb_private::ArchSpec &arch)

Public Attributes

char pr_state
char pr_sname
char pr_zomb
char pr_nice
uint64_t pr_flag
uint32_t pr_uid
uint32_t pr_gid
int32_t pr_pid
int32_t pr_ppid
int32_t pr_pgrp
int32_t pr_sid
char pr_fname [16]
char pr_psargs [80]

Detailed Description

Definition at line 96 of file ThreadElfCore.h.

Constructor & Destructor Documentation

◆ ELFLinuxPrPsInfo()

ELFLinuxPrPsInfo::ELFLinuxPrPsInfo ( )

Definition at line 384 of file ThreadElfCore.cpp.

References ELFLinuxPrPsInfo().

Referenced by ELFLinuxPrPsInfo(), GetSize(), and Populate().

Member Function Documentation

◆ GetSize()

◆ Parse()

◆ Populate() [1/2]

std::optional< ELFLinuxPrPsInfo > ELFLinuxPrPsInfo::Populate ( const lldb::ProcessSP & process_sp)
static

Definition at line 460 of file ThreadElfCore.cpp.

References Populate().

Referenced by Populate().

◆ Populate() [2/2]

std::optional< ELFLinuxPrPsInfo > ELFLinuxPrPsInfo::Populate ( const lldb_private::ProcessInstanceInfo & info,
lldb::StateType state )
static

In the linux kernel this comes from: state = READ_ONCE(p->__state); i = state ? ffz(~state) + 1 : 0; psinfo->pr_sname = (i > 5) ? '.' : "RSDTZW"[i];

So we replicate that here. From proc_pid_stats(5) R = Running S = Sleeping on uninterrutible wait D = Waiting on uninterruptable disk sleep T = Tracing stop Z = Zombie W = Paging

pr_flags is left as 0. The values (in linux) are specific to the kernel. We recover them from the proc filesystem but don't put them in ProcessInfo because it would really become very linux specific and the utility here seems pretty dubious

Definition at line 469 of file ThreadElfCore.cpp.

References lldb_private::ProcessInstanceInfo::EffectiveGroupIDIsValid(), lldb_private::ProcessInstanceInfo::EffectiveUserIDIsValid(), ELFLinuxPrPsInfo(), lldb::eStateRunning, lldb::eStateStepping, lldb::eStateStopped, lldb::eStateSuspended, lldb::eStateUnloaded, lldb_private::ProcessInfo::GetArguments(), lldb_private::ProcessInfo::GetGroupID(), lldb_private::ProcessInfo::GetNameAsStringRef(), lldb_private::ProcessInstanceInfo::GetParentProcessID(), lldb_private::ProcessInstanceInfo::GetPriorityValue(), lldb_private::ProcessInstanceInfo::GetProcessGroupID(), lldb_private::ProcessInfo::GetProcessID(), lldb_private::ProcessInstanceInfo::GetProcessSessionID(), lldb_private::ProcessInfo::GetUserID(), lldb_private::ProcessInstanceInfo::IsZombie(), lldb_private::ProcessInstanceInfo::ParentProcessIDIsValid(), pr_fname, pr_gid, pr_nice, pr_pgrp, pr_pid, pr_ppid, pr_psargs, pr_sid, pr_sname, pr_state, pr_uid, pr_zomb, lldb_private::ProcessInstanceInfo::ProcessGroupIDIsValid(), and lldb_private::ProcessInstanceInfo::ProcessSessionIDIsValid().

Member Data Documentation

◆ pr_flag

uint64_t ELFLinuxPrPsInfo::pr_flag

Definition at line 101 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_fname

char ELFLinuxPrPsInfo::pr_fname[16]

Definition at line 108 of file ThreadElfCore.h.

Referenced by Parse(), ProcessElfCore::parseLinuxNotes(), and Populate().

◆ pr_gid

uint32_t ELFLinuxPrPsInfo::pr_gid

Definition at line 103 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_nice

char ELFLinuxPrPsInfo::pr_nice

Definition at line 100 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_pgrp

int32_t ELFLinuxPrPsInfo::pr_pgrp

Definition at line 106 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_pid

int32_t ELFLinuxPrPsInfo::pr_pid

Definition at line 104 of file ThreadElfCore.h.

Referenced by Parse(), ProcessElfCore::parseLinuxNotes(), and Populate().

◆ pr_ppid

int32_t ELFLinuxPrPsInfo::pr_ppid

Definition at line 105 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_psargs

char ELFLinuxPrPsInfo::pr_psargs[80]

Definition at line 109 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_sid

int32_t ELFLinuxPrPsInfo::pr_sid

Definition at line 107 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_sname

char ELFLinuxPrPsInfo::pr_sname

Definition at line 98 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_state

char ELFLinuxPrPsInfo::pr_state

Definition at line 97 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_uid

uint32_t ELFLinuxPrPsInfo::pr_uid

Definition at line 102 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().

◆ pr_zomb

char ELFLinuxPrPsInfo::pr_zomb

Definition at line 99 of file ThreadElfCore.h.

Referenced by Parse(), and Populate().


The documentation for this struct was generated from the following files: