LLDB mainline
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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 103 of file ThreadElfCore.h.

Constructor & Destructor Documentation

◆ ELFLinuxPrPsInfo()

ELFLinuxPrPsInfo::ELFLinuxPrPsInfo ( )

Definition at line 349 of file ThreadElfCore.cpp.

Referenced by GetSize().

Member Function Documentation

◆ GetSize()

size_t ELFLinuxPrPsInfo::GetSize ( const lldb_private::ArchSpec arch)
static

◆ Parse()

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

◆ Populate() [1/2]

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

Definition at line 425 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 434 of file ThreadElfCore.cpp.

References lldb_private::ProcessInstanceInfo::EffectiveGroupIDIsValid(), lldb_private::ProcessInstanceInfo::EffectiveUserIDIsValid(), 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_pid, lldb_private::ProcessInstanceInfo::ProcessGroupIDIsValid(), and lldb_private::ProcessInstanceInfo::ProcessSessionIDIsValid().

Member Data Documentation

◆ pr_flag

uint64_t ELFLinuxPrPsInfo::pr_flag

Definition at line 108 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_fname

char ELFLinuxPrPsInfo::pr_fname[16]

Definition at line 115 of file ThreadElfCore.h.

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

◆ pr_gid

uint32_t ELFLinuxPrPsInfo::pr_gid

Definition at line 110 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_nice

char ELFLinuxPrPsInfo::pr_nice

Definition at line 107 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_pgrp

int32_t ELFLinuxPrPsInfo::pr_pgrp

Definition at line 113 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_pid

int32_t ELFLinuxPrPsInfo::pr_pid

Definition at line 111 of file ThreadElfCore.h.

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

◆ pr_ppid

int32_t ELFLinuxPrPsInfo::pr_ppid

Definition at line 112 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_psargs

char ELFLinuxPrPsInfo::pr_psargs[80]

Definition at line 116 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_sid

int32_t ELFLinuxPrPsInfo::pr_sid

Definition at line 114 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_sname

char ELFLinuxPrPsInfo::pr_sname

Definition at line 105 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_state

char ELFLinuxPrPsInfo::pr_state

Definition at line 104 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_uid

uint32_t ELFLinuxPrPsInfo::pr_uid

Definition at line 109 of file ThreadElfCore.h.

Referenced by Parse().

◆ pr_zomb

char ELFLinuxPrPsInfo::pr_zomb

Definition at line 106 of file ThreadElfCore.h.

Referenced by Parse().


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