[Lldb-commits] [lldb] ae8a5c6 - [debugserver] Use class member initialization for RNBContext
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 13 10:39:34 PDT 2021
Author: Jonas Devlieghere
Date: 2021-04-13T10:39:27-07:00
New Revision: ae8a5c68523c1d23dec721e28f89084d6561522a
URL: https://github.com/llvm/llvm-project/commit/ae8a5c68523c1d23dec721e28f89084d6561522a
DIFF: https://github.com/llvm/llvm-project/commit/ae8a5c68523c1d23dec721e28f89084d6561522a.diff
LOG: [debugserver] Use class member initialization for RNBContext
Address Shafik Yaghmour's post commit code review feedback.
Added:
Modified:
lldb/tools/debugserver/source/RNBContext.h
Removed:
################################################################################
diff --git a/lldb/tools/debugserver/source/RNBContext.h b/lldb/tools/debugserver/source/RNBContext.h
index 03cd7f350e63..562adadd874d 100644
--- a/lldb/tools/debugserver/source/RNBContext.h
+++ b/lldb/tools/debugserver/source/RNBContext.h
@@ -43,12 +43,7 @@ class RNBContext {
all_event_bits = sticky_event_bits | normal_event_bits
} event_t;
// Constructors and Destructors
- RNBContext()
- : m_pid(INVALID_NUB_PROCESS), m_pid_stop_count(0),
- m_events(0, all_event_bits), m_pid_pthread(), m_launch_status(),
- m_arg_vec(), m_env_vec(), m_detach_on_error(false),
- m_unmask_signals(false) {}
-
+ RNBContext() = default;
virtual ~RNBContext();
nub_process_t ProcessID() const { return m_pid; }
@@ -132,24 +127,26 @@ class RNBContext {
protected:
// Classes that inherit from RNBContext can see and modify these
- nub_process_t m_pid;
+ nub_process_t m_pid = INVALID_NUB_PROCESS;
std::string m_stdin;
std::string m_stdout;
std::string m_stderr;
std::string m_working_dir;
- nub_size_t m_pid_stop_count;
- PThreadEvent m_events; // Threaded events that we can wait for
+ nub_size_t m_pid_stop_count = 0;
+ /// Threaded events that we can wait for.
+ PThreadEvent m_events{0, all_event_bits};
pthread_t m_pid_pthread;
- nub_launch_flavor_t m_launch_flavor; // How to launch our inferior process
- DNBError
- m_launch_status; // This holds the status from the last launch attempt.
+ /// How to launch our inferior process.
+ nub_launch_flavor_t m_launch_flavor = eLaunchFlavorDefault;
+ /// This holds the status from the last launch attempt.
+ DNBError m_launch_status;
std::vector<std::string> m_arg_vec;
- std::vector<std::string>
- m_env_vec; // This will be unparsed - entries FOO=value
+ /// This will be unparsed entries FOO=value
+ std::vector<std::string> m_env_vec;
std::string m_working_directory;
std::string m_process_event;
- bool m_detach_on_error;
- bool m_unmask_signals;
+ bool m_detach_on_error = false;
+ bool m_unmask_signals = false;
void StartProcessStatusThread();
void StopProcessStatusThread();
More information about the lldb-commits
mailing list