Skip to content

Commit 03d5449

Browse files
committed
Add IsCoredumping to ProcessInfo to use in the future of the ptrace_seize code
1 parent 673047e commit 03d5449

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lldb/include/lldb/Utility/ProcessInfo.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ class ProcessInstanceInfo : public ProcessInfo {
247247

248248
std::optional<bool> IsZombie() const { return m_zombie; }
249249

250+
// proc/../status specifies CoreDumping as the field
251+
// so we match the case here.
252+
void SetIsCoreDumping(bool is_coredumping) { m_coredumping = is_coredumping; }
253+
std::optional<bool> IsCoreDumping() const { return m_coredumping; }
254+
250255
void Dump(Stream &s, UserIDResolver &resolver) const;
251256

252257
static void DumpTableHeader(Stream &s, bool show_args, bool verbose);
@@ -266,6 +271,7 @@ class ProcessInstanceInfo : public ProcessInfo {
266271
struct timespec m_cumulative_system_time;
267272
std::optional<int8_t> m_priority_value = std::nullopt;
268273
std::optional<bool> m_zombie = std::nullopt;
274+
std::optional<bool> m_coredumping = std::nullopt;
269275
};
270276

271277
typedef std::vector<ProcessInstanceInfo> ProcessInstanceInfoList;

lldb/source/Host/linux/Host.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ static bool GetStatusInfo(::pid_t Pid, ProcessInstanceInfo &ProcessInfo,
213213
} else if (Line.consume_front("Tgid:")) {
214214
Line = Line.ltrim();
215215
Line.consumeInteger(10, Tgid);
216+
} else if (Line.consume_front("CoreDumping:")) {
217+
uint32_t coredumping;
218+
Line = Line.ltrim();
219+
Line.consumeInteger(1, coredumping);
220+
ProcessInfo.SetIsCoredumping(coredumping);
216221
}
217222
}
218223
return true;

0 commit comments

Comments
 (0)