From: Jonas Devlieghere Date: Tue, 13 Apr 2021 17:23:04 +0000 (-0700) Subject: [debugserver] Use class member initialization for RNBContext X-Git-Tag: llvmorg-14-init~9706 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae8a5c68523c1d23dec721e28f89084d6561522a;p=platform%2Fupstream%2Fllvm.git [debugserver] Use class member initialization for RNBContext Address Shafik Yaghmour's post commit code review feedback. --- diff --git a/lldb/tools/debugserver/source/RNBContext.h b/lldb/tools/debugserver/source/RNBContext.h index 03cd7f35..562adad 100644 --- a/lldb/tools/debugserver/source/RNBContext.h +++ b/lldb/tools/debugserver/source/RNBContext.h @@ -43,12 +43,7 @@ public: 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 @@ public: 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 m_arg_vec; - std::vector - m_env_vec; // This will be unparsed - entries FOO=value + /// This will be unparsed entries FOO=value + std::vector 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();