From 49be160531053ba001f0337951572ea9de064eb9 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 25 Feb 2015 19:52:41 +0000 Subject: [PATCH] Revert "Fix warnings found with clang-cl." SWIG doesn't like enum : unsigned. Revert this until I can fix this in a way that swig likes. llvm-svn: 230531 --- lldb/include/lldb/API/SBCommunication.h | 2 +- lldb/include/lldb/API/SBValue.h | 1 + lldb/include/lldb/Core/Communication.h | 16 ++++++++-------- lldb/include/lldb/Host/OptionParser.h | 2 +- lldb/include/lldb/Host/Socket.h | 2 -- lldb/include/lldb/Host/msvc/Config.h | 2 +- .../include/lldb/Host/windows/getopt/GetOptInc.h | 2 +- .../lldb/Interpreter/ScriptInterpreterPython.h | 2 ++ lldb/include/lldb/Symbol/Type.h | 2 +- lldb/include/lldb/Target/SectionLoadHistory.h | 2 +- lldb/include/lldb/lldb-enumerations.h | 2 +- lldb/source/Host/common/OptionParser.cpp | 2 +- lldb/source/Host/common/Socket.cpp | 6 +++--- lldb/source/Host/common/Terminal.cpp | 6 ++++-- .../windows/ConnectionGenericFileWindows.cpp | 4 ++-- lldb/source/Host/windows/EditLineWin.cpp | 4 ++-- lldb/source/Host/windows/HostProcessWindows.cpp | 2 +- lldb/source/Host/windows/ThisThread.cpp | 6 +++--- lldb/source/Host/windows/getopt/GetOptInc.cpp | 14 +++++++++++--- .../Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp | 4 ++-- .../Plugins/Process/Windows/DebuggerThread.cpp | 1 + .../Plugins/Process/Windows/LocalDebugDelegate.h | 2 +- .../Plugins/Process/Windows/ProcessWindows.cpp | 7 +++++-- .../Process/Windows/TargetThreadWindows.cpp | 2 +- .../Windows/x86/RegisterContextWindows_x86.cpp | 2 +- lldb/source/Target/Process.cpp | 2 +- lldb/source/Utility/PseudoTerminal.cpp | 6 +++--- 27 files changed, 60 insertions(+), 45 deletions(-) diff --git a/lldb/include/lldb/API/SBCommunication.h b/lldb/include/lldb/API/SBCommunication.h index eec90d22f0b5..fa60e6339a10 100644 --- a/lldb/include/lldb/API/SBCommunication.h +++ b/lldb/include/lldb/API/SBCommunication.h @@ -18,7 +18,7 @@ namespace lldb { class LLDB_API SBCommunication { public: - enum : unsigned { + enum { eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost. eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available. eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients. diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index 4de0b55862b9..1dc5cc2981ce 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -21,6 +21,7 @@ namespace lldb { class LLDB_API SBValue { +friend class ValueLocker; public: SBValue (); diff --git a/lldb/include/lldb/Core/Communication.h b/lldb/include/lldb/Core/Communication.h index bd6130098019..49532fe123c5 100644 --- a/lldb/include/lldb/Core/Communication.h +++ b/lldb/include/lldb/Core/Communication.h @@ -85,14 +85,14 @@ namespace lldb_private { class Communication : public Broadcaster { public: - enum : unsigned { - eBroadcastBitDisconnected = (1u << 0), ///< Sent when the communications connection is lost. - eBroadcastBitReadThreadGotBytes = (1u << 1), ///< Sent by the read thread when bytes become available. - eBroadcastBitReadThreadDidExit = (1u << 2), ///< Sent by the read thread when it exits to inform clients. - eBroadcastBitReadThreadShouldExit = (1u << 3), ///< Sent by clients that need to cancel the read thread. - eBroadcastBitPacketAvailable = (1u << 4), ///< Sent when data received makes a complete packet. - kLoUserBroadcastBit = (1u << 16),///< Subclasses can used bits 31:16 for any needed events. - kHiUserBroadcastBit = (1u << 31), + enum { + eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost. + eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available. + eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients. + eBroadcastBitReadThreadShouldExit = (1 << 3), ///< Sent by clients that need to cancel the read thread. + eBroadcastBitPacketAvailable = (1 << 4), ///< Sent when data received makes a complete packet. + kLoUserBroadcastBit = (1 << 16),///< Subclasses can used bits 31:16 for any needed events. + kHiUserBroadcastBit = (1 << 31), eAllEventBits = 0xffffffff }; diff --git a/lldb/include/lldb/Host/OptionParser.h b/lldb/include/lldb/Host/OptionParser.h index a169ce6ad6ce..5aa7db5d34bf 100644 --- a/lldb/include/lldb/Host/OptionParser.h +++ b/lldb/include/lldb/Host/OptionParser.h @@ -46,7 +46,7 @@ public: const char *optstring, const Option *longopts, int *longindex); - static const char* GetOptionArgument(); + static char* GetOptionArgument(); static int GetOptionIndex(); static int GetOptionErrorCause(); static std::string GetShortOptionString(struct option *long_options); diff --git a/lldb/include/lldb/Host/Socket.h b/lldb/include/lldb/Host/Socket.h index bad6553078ab..ee85f85fcaf2 100644 --- a/lldb/include/lldb/Host/Socket.h +++ b/lldb/include/lldb/Host/Socket.h @@ -34,10 +34,8 @@ namespace lldb_private { #if defined(_MSC_VER) typedef SOCKET NativeSocket; - inline bool IS_VALID_SOCKET(NativeSocket socket) { return socket != INVALID_SOCKET; } #else typedef int NativeSocket; - inline bool IS_VALID_SOCKET(NativeSocket socket) { return socket >= 0; } #endif class Socket : public IOObject diff --git a/lldb/include/lldb/Host/msvc/Config.h b/lldb/include/lldb/Host/msvc/Config.h index ac7d9003bbe7..bdf404c4f468 100644 --- a/lldb/include/lldb/Host/msvc/Config.h +++ b/lldb/include/lldb/Host/msvc/Config.h @@ -29,7 +29,7 @@ #if _HAS_EXCEPTIONS == 0 // Exceptions are disabled so this isn't defined, but concrt assumes it is. -inline void *__uncaught_exception() { return nullptr; } +static void *__uncaught_exception() { return nullptr; } #endif #endif // #ifndef liblldb_Platform_Config_h_ diff --git a/lldb/include/lldb/Host/windows/getopt/GetOptInc.h b/lldb/include/lldb/Host/windows/getopt/GetOptInc.h index f58e063166f6..53ce19daa8ad 100644 --- a/lldb/include/lldb/Host/windows/getopt/GetOptInc.h +++ b/lldb/include/lldb/Host/windows/getopt/GetOptInc.h @@ -21,7 +21,7 @@ struct option int getopt( int argc, char * const argv[], const char *optstring ); // from getopt.h -extern const char * optarg; +extern char * optarg; extern int optind; extern int opterr; extern int optopt; diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h index 87177eab5522..94ed16e02ca2 100644 --- a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h +++ b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h @@ -34,6 +34,8 @@ class ScriptInterpreterPython : { public: + friend class IOHandlerPythonInterpreter; + ScriptInterpreterPython (CommandInterpreter &interpreter); ~ScriptInterpreterPython (); diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index fa79e967698c..51bd3dd82c92 100644 --- a/lldb/include/lldb/Symbol/Type.h +++ b/lldb/include/lldb/Symbol/Type.h @@ -71,7 +71,7 @@ public: eEncodingIsSyntheticUID } EncodingDataType; - typedef enum ResolveStateTag : unsigned + typedef enum ResolveStateTag { eResolveStateUnresolved = 0, eResolveStateForward = 1, diff --git a/lldb/include/lldb/Target/SectionLoadHistory.h b/lldb/include/lldb/Target/SectionLoadHistory.h index ddf46a1861ca..50dcfd3cc870 100644 --- a/lldb/include/lldb/Target/SectionLoadHistory.h +++ b/lldb/include/lldb/Target/SectionLoadHistory.h @@ -23,7 +23,7 @@ namespace lldb_private { class SectionLoadHistory { public: - enum : unsigned { + enum { // Pass eStopIDNow to any function that takes a stop ID to get // the current value. eStopIDNow = UINT32_MAX diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index f5ef1e483db3..7b5ea7020fdd 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -652,7 +652,7 @@ namespace lldb { eBasicTypeOther } BasicType; - typedef enum TypeClass : unsigned + typedef enum TypeClass { eTypeClassInvalid = (0u), eTypeClassArray = (1u << 0), diff --git a/lldb/source/Host/common/OptionParser.cpp b/lldb/source/Host/common/OptionParser.cpp index edd8679d6aca..a91e764bfe3b 100644 --- a/lldb/source/Host/common/OptionParser.cpp +++ b/lldb/source/Host/common/OptionParser.cpp @@ -54,7 +54,7 @@ OptionParser::Parse (int argc, return getopt_long_only(argc, argv, optstring, &opts[0], longindex); } -const char* +char* OptionParser::GetOptionArgument() { return optarg; diff --git a/lldb/source/Host/common/Socket.cpp b/lldb/source/Host/common/Socket.cpp index 46f36ed59471..b5559fffb45d 100644 --- a/lldb/source/Host/common/Socket.cpp +++ b/lldb/source/Host/common/Socket.cpp @@ -699,7 +699,7 @@ int Socket::SetOption(int level, int option_name, int option_value) uint16_t Socket::GetLocalPortNumber(const NativeSocket& socket) { // We bound to port zero, so we need to figure out which port we actually bound to - if (IS_VALID_SOCKET(socket)) + if (socket >= 0) { SocketAddress sock_addr; socklen_t sock_addr_len = sock_addr.GetMaxLength (); @@ -730,7 +730,7 @@ std::string Socket::GetLocalIPAddress () const uint16_t Socket::GetRemotePortNumber () const { - if (IS_VALID_SOCKET(m_socket)) + if (m_socket >= 0) { SocketAddress sock_addr; socklen_t sock_addr_len = sock_addr.GetMaxLength (); @@ -743,7 +743,7 @@ uint16_t Socket::GetRemotePortNumber () const std::string Socket::GetRemoteIPAddress () const { // We bound to port zero, so we need to figure out which port we actually bound to - if (IS_VALID_SOCKET(m_socket)) + if (m_socket >= 0) { SocketAddress sock_addr; socklen_t sock_addr_len = sock_addr.GetMaxLength (); diff --git a/lldb/source/Host/common/Terminal.cpp b/lldb/source/Host/common/Terminal.cpp index 9f3abb75e919..ca46eb0f744b 100644 --- a/lldb/source/Host/common/Terminal.cpp +++ b/lldb/source/Host/common/Terminal.cpp @@ -180,18 +180,20 @@ TerminalState::Save (int fd, bool save_process_group) bool TerminalState::Restore () const { -#ifndef LLDB_DISABLE_POSIX if (IsValid()) { const int fd = m_tty.GetFileDescriptor(); +#ifndef LLDB_DISABLE_POSIX if (TFlagsIsValid()) fcntl (fd, F_SETFL, m_tflags); +#endif #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED if (TTYStateIsValid()) tcsetattr (fd, TCSANOW, m_termios_ap.get()); #endif // #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED +#ifndef LLDB_DISABLE_POSIX if (ProcessGroupIsValid()) { // Save the original signal handler. @@ -202,9 +204,9 @@ TerminalState::Restore () const // Restore the original signal handler. signal (SIGTTOU, saved_sigttou_callback); } +#endif return true; } -#endif return false; } diff --git a/lldb/source/Host/windows/ConnectionGenericFileWindows.cpp b/lldb/source/Host/windows/ConnectionGenericFileWindows.cpp index e2b23d0a0f50..bbf315019aa5 100644 --- a/lldb/source/Host/windows/ConnectionGenericFileWindows.cpp +++ b/lldb/source/Host/windows/ConnectionGenericFileWindows.cpp @@ -208,9 +208,9 @@ ConnectionGenericFile::Read(void *dst, size_t dst_len, uint32_t timeout_usec, ll TimeValue time_value; time_value.OffsetWithMicroSeconds(timeout_usec); DWORD milliseconds = time_value.milliseconds(); - DWORD wait_result = ::WaitForMultipleObjects(llvm::array_lengthof(m_event_handles), m_event_handles, FALSE, milliseconds); + result = ::WaitForMultipleObjects(llvm::array_lengthof(m_event_handles), m_event_handles, FALSE, milliseconds); // All of the events are manual reset events, so make sure we reset them to non-signalled. - switch (wait_result) + switch (result) { case WAIT_OBJECT_0 + kBytesAvailableEvent: break; diff --git a/lldb/source/Host/windows/EditLineWin.cpp b/lldb/source/Host/windows/EditLineWin.cpp index 49f7def59766..6bd7e161cd04 100644 --- a/lldb/source/Host/windows/EditLineWin.cpp +++ b/lldb/source/Host/windows/EditLineWin.cpp @@ -247,10 +247,10 @@ el_set (EditLine *el, int code, ...) // get the function pointer from the arg list void *func_vp = (void*)va_arg(vl, el_prompt_func); - va_arg(vl, int); + char escape = (char)va_arg(vl, int); // call to get the prompt as a string el_prompt_func func_fp = (el_prompt_func)func_vp; - func_fp(el); + const char *newPrompt = func_fp(el); } break; diff --git a/lldb/source/Host/windows/HostProcessWindows.cpp b/lldb/source/Host/windows/HostProcessWindows.cpp index 0f81c18d34af..d8e407c667ac 100644 --- a/lldb/source/Host/windows/HostProcessWindows.cpp +++ b/lldb/source/Host/windows/HostProcessWindows.cpp @@ -120,7 +120,7 @@ HostProcessWindows::MonitorThread(void *thread_arg) MonitorInfo *info = static_cast(thread_arg); if (info) { - ::WaitForSingleObject(info->process_handle, INFINITE); + DWORD wait_result = ::WaitForSingleObject(info->process_handle, INFINITE); ::GetExitCodeProcess(info->process_handle, &exit_code); info->callback(info->baton, ::GetProcessId(info->process_handle), true, 0, exit_code); ::CloseHandle(info->process_handle); diff --git a/lldb/source/Host/windows/ThisThread.cpp b/lldb/source/Host/windows/ThisThread.cpp index d5f5810b08e4..9c37d7c57e7a 100644 --- a/lldb/source/Host/windows/ThisThread.cpp +++ b/lldb/source/Host/windows/ThisThread.cpp @@ -20,6 +20,8 @@ using namespace lldb_private; namespace { +static const DWORD MS_VC_EXCEPTION = 0x406D1388; + #pragma pack(push, 8) struct THREADNAME_INFO { @@ -36,9 +38,7 @@ ThisThread::SetName(llvm::StringRef name) { // Other compilers don't yet support SEH, so we can only set the thread if compiling with MSVC. // TODO(zturner): Once clang-cl supports SEH, relax this conditional. -#if defined(_MSC_VER) && !defined(__clang__) /* clang-cl doesn't support SEH */ - static const DWORD MS_VC_EXCEPTION = 0x406D1388; - +#if defined(_MSC_VER) THREADNAME_INFO info; info.dwType = 0x1000; info.szName = name.data(); diff --git a/lldb/source/Host/windows/getopt/GetOptInc.cpp b/lldb/source/Host/windows/getopt/GetOptInc.cpp index cae310326f5e..612fc9f8147e 100644 --- a/lldb/source/Host/windows/getopt/GetOptInc.cpp +++ b/lldb/source/Host/windows/getopt/GetOptInc.cpp @@ -9,7 +9,7 @@ int opterr = 1; /* if error message should be printed */ int optind = 1; /* index into parent argv vector */ int optopt = '?'; /* character checked for validity */ int optreset; /* reset getopt */ -const char *optarg; /* argument associated with option */ +char *optarg; /* argument associated with option */ #define PRINT_ERROR ((opterr) && (*options != ':')) @@ -31,12 +31,20 @@ static int parse_long_options(char * const *, const char *, static int gcd(int, int); static void permute_args(int, int, int, char * const *); -static const char *place = EMSG; /* option letter processing */ +static char *place = EMSG; /* option letter processing */ /* XXX: set optreset to 1 rather than these two */ static int nonopt_start = -1; /* first non option argument (for permute) */ static int nonopt_end = -1; /* first option after non options (for permute) */ +/* Error messages */ +static const char recargchar[] = "option requires an argument -- %c"; +static const char recargstring[] = "option requires an argument -- %s"; +static const char ambig[] = "ambiguous option -- %.*s"; +static const char noarg[] = "option doesn't take an argument -- %.*s"; +static const char illoptchar[] = "unknown option -- %c"; +static const char illoptstring[] = "unknown option -- %s"; + /* * Compute the greatest common divisor of a and b. */ @@ -104,7 +112,7 @@ static int parse_long_options(char * const *nargv, const char *options, const struct option *long_options, int *idx, int short_too) { - const char *current_argv, *has_equal; + char *current_argv, *has_equal; size_t current_argv_len; int i, match; diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp index a0d632fde5ab..72074d31a7dc 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp @@ -269,7 +269,7 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread, #if HEX_ABI_DEBUG // print the original stack pointer - printf( "sp : %04llx \n", sp ); + printf( "sp : %04lx \n", sp ); #endif // make sure number of parameters matches prototype @@ -337,7 +337,7 @@ ABISysV_hexagon::PrepareTrivialCall ( Thread &thread, uint32_t data = 0; lldb::addr_t addr = sp + i * 4; proc->ReadMemory( addr, (void*)&data, sizeof( data ), error ); - printf( "\n0x%04llx 0x%08x ", addr, data ); + printf( "\n0x%04lx 0x%08x ", addr, data ); if ( i == 0 ) printf( "<<-- sp" ); } printf( "\n" ); diff --git a/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp b/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp index df75bf722063..7021f7852215 100644 --- a/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp +++ b/lldb/source/Plugins/Process/Windows/DebuggerThread.cpp @@ -79,6 +79,7 @@ DebuggerThread::DebuggerThreadRoutine(const ProcessLaunchInfo &launch_info) // Grab a shared_ptr reference to this so that we know it won't get deleted until after the // thread routine has exited. std::shared_ptr this_ref(shared_from_this()); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS)); Error error; ProcessLauncherWindows launcher; diff --git a/lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h b/lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h index 8aade4d3e743..11fa1a82904a 100644 --- a/lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h +++ b/lldb/source/Plugins/Process/Windows/LocalDebugDelegate.h @@ -40,7 +40,7 @@ namespace lldb_private class LocalDebugDelegate : public IDebugDelegate { public: - explicit LocalDebugDelegate(lldb::ProcessSP process); + explicit LocalDebugDelegate::LocalDebugDelegate(lldb::ProcessSP process); virtual void OnExitProcess(uint32_t exit_code) override; virtual void OnDebuggerConnected(lldb::addr_t image_base) override; diff --git a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp index 5dbdfb123eda..ce3f0201eab4 100644 --- a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp @@ -55,8 +55,8 @@ class ProcessWindowsData { public: ProcessWindowsData(const ProcessLaunchInfo &launch_info) - : m_launch_info(launch_info) - , m_initial_stop_event(nullptr) + : m_initial_stop_event(nullptr) + , m_launch_info(launch_info) , m_initial_stop_received(false) { m_initial_stop_event = ::CreateEvent(nullptr, TRUE, FALSE, nullptr); @@ -334,6 +334,7 @@ ProcessWindows::RefreshStateAfterStop() BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc - 1)); if (site && site->ValidForThisThread(stop_thread.get())) { + lldb::break_id_t break_id = LLDB_INVALID_BREAK_ID; stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(*stop_thread, site->GetID()); register_context->SetPC(pc - 1); } @@ -392,6 +393,7 @@ void ProcessWindows::DidLaunch() { llvm::sys::ScopedLock lock(m_mutex); + StateType state = GetPrivateState(); // The initial stop won't broadcast the state change event, so account for that here. if (m_session_data && GetPrivateState() == eStateStopped && m_session_data->m_launch_info.GetFlags().Test(eLaunchFlagStopAtEntry)) @@ -555,6 +557,7 @@ ProcessWindows::OnDebugException(bool first_chance, const ExceptionRecord &recor } ExceptionResult result = ExceptionResult::SendToApplication; + lldb::StateType state = GetPrivateState(); switch (record.GetExceptionCode()) { case EXCEPTION_BREAKPOINT: diff --git a/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp b/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp index 6cc60ee04a3e..b57f33f0dd5e 100644 --- a/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/TargetThreadWindows.cpp @@ -38,7 +38,7 @@ TargetThreadWindows::~TargetThreadWindows() void TargetThreadWindows::RefreshStateAfterStop() { - ::SuspendThread(m_host_thread.GetNativeThread().GetSystemHandle()); + DWORD old_suspend_count = ::SuspendThread(m_host_thread.GetNativeThread().GetSystemHandle()); GetRegisterContext()->InvalidateIfNeeded(false); } diff --git a/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp index 9051e9244b7e..46f76b667929 100644 --- a/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp +++ b/lldb/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp @@ -93,8 +93,8 @@ RegisterSet g_register_sets[] = { //------------------------------------------------------------------ RegisterContextWindows_x86::RegisterContextWindows_x86(Thread &thread, uint32_t concrete_frame_idx) : RegisterContext(thread, concrete_frame_idx) - , m_context() , m_context_stale(true) + , m_context() { } diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 7a93337f002d..2a76e88f2bbf 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -5010,6 +5010,7 @@ public: if (OpenPipes()) { const int read_fd = m_read_file.GetDescriptor(); + const int pipe_read_fd = m_pipe.GetReadFileDescriptor(); TerminalState terminal_state; terminal_state.Save (read_fd, false); Terminal terminal(read_fd); @@ -5017,7 +5018,6 @@ public: terminal.SetEcho(false); // FD_ZERO, FD_SET are not supported on windows #ifndef _WIN32 - const int pipe_read_fd = m_pipe.GetReadFileDescriptor(); while (!GetIsDone()) { fd_set read_fdset; diff --git a/lldb/source/Utility/PseudoTerminal.cpp b/lldb/source/Utility/PseudoTerminal.cpp index 36d82aeb60e5..e728d4ab2a98 100644 --- a/lldb/source/Utility/PseudoTerminal.cpp +++ b/lldb/source/Utility/PseudoTerminal.cpp @@ -235,13 +235,14 @@ PseudoTerminal::GetSlaveName (char *error_str, size_t error_len) const lldb::pid_t PseudoTerminal::Fork (char *error_str, size_t error_len) { - pid_t pid = LLDB_INVALID_PROCESS_ID; -#if !defined(_MSC_VER) if (error_str) error_str[0] = '\0'; + pid_t pid = LLDB_INVALID_PROCESS_ID; int flags = O_RDWR; +#if !defined(_MSC_VER) flags |= O_CLOEXEC; +#endif if (OpenFirstAvailableMaster (flags, error_str, error_len)) { // Successfully opened our master pseudo terminal @@ -299,7 +300,6 @@ PseudoTerminal::Fork (char *error_str, size_t error_len) // Do nothing and let the pid get returned! } } -#endif return pid; }