================ @@ -147,96 +148,111 @@ class ProcessInstanceInfo : public ProcessInfo { ProcessInstanceInfo() = default; ProcessInstanceInfo(const char *name, const ArchSpec &arch, lldb::pid_t pid) - : ProcessInfo(name, arch, pid), m_euid(UINT32_MAX), m_egid(UINT32_MAX), - m_parent_pid(LLDB_INVALID_PROCESS_ID) {} + : ProcessInfo(name, arch, pid) {} void Clear() { ProcessInfo::Clear(); - m_euid = UINT32_MAX; - m_egid = UINT32_MAX; - m_parent_pid = LLDB_INVALID_PROCESS_ID; + m_euid = std::nullopt; + m_egid = std::nullopt; + m_parent_pid = std::nullopt; } - uint32_t GetEffectiveUserID() const { return m_euid; } + uint32_t GetEffectiveUserID() const { return m_euid.value(); } ---------------- clayborg wrote:
It is ok to not do all of the ivars at one, but for the `std::optional` stuff that remains, if we just call `.value()` and it hasn't been set we are going to throw an exception right? We either need to make these not optional, or return the optional when accessing and let the callers deal with the values no being available. https://github.com/llvm/llvm-project/pull/91544 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits