diff options
Diffstat (limited to 'include/lldb')
-rw-r--r-- | include/lldb/Host/Host.h | 55 | ||||
-rw-r--r-- | include/lldb/Host/common/NativeProcessProtocol.h | 13 | ||||
-rw-r--r-- | include/lldb/Host/posix/ProcessLauncherPosix.h | 24 | ||||
-rw-r--r-- | include/lldb/lldb-enumerations.h | 2 | ||||
-rw-r--r-- | include/lldb/lldb-private-enumerations.h | 13 |
5 files changed, 37 insertions, 70 deletions
diff --git a/include/lldb/Host/Host.h b/include/lldb/Host/Host.h index c474dccab5db5..bf48e207f1f28 100644 --- a/include/lldb/Host/Host.h +++ b/include/lldb/Host/Host.h @@ -29,6 +29,27 @@ class FileAction; class ProcessLaunchInfo; //---------------------------------------------------------------------- +// Exit Type for inferior processes +//---------------------------------------------------------------------- +struct WaitStatus { + enum Type : uint8_t { + Exit, // The status represents the return code from normal + // program exit (i.e. WIFEXITED() was true) + Signal, // The status represents the signal number that caused + // the program to exit (i.e. WIFSIGNALED() was true) + Stop, // The status represents the signal number that caused the + // program to stop (i.e. WIFSTOPPED() was true) + }; + + Type type; + uint8_t status; + + WaitStatus(Type type, uint8_t status) : type(type), status(status) {} + + static WaitStatus Decode(int wstatus); +}; + +//---------------------------------------------------------------------- /// @class Host Host.h "lldb/Host/Host.h" /// @brief A class that provides host computer information. /// @@ -111,15 +132,6 @@ public: static const char *GetSignalAsCString(int signo); - typedef void (*ThreadLocalStorageCleanupCallback)(void *p); - - static lldb::thread_key_t - ThreadLocalStorageCreate(ThreadLocalStorageCleanupCallback callback); - - static void *ThreadLocalStorageGet(lldb::thread_key_t key); - - static void ThreadLocalStorageSet(lldb::thread_key_t key, void *value); - //------------------------------------------------------------------ /// Given an address in the current process (the process that /// is running the LLDB code), return the name of the module that @@ -184,22 +196,6 @@ public: static bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info); -#if (defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || \ - defined(__GLIBC__) || defined(__NetBSD__) || defined(__OpenBSD__)) && \ - !defined(__ANDROID__) - - static short GetPosixspawnFlags(const ProcessLaunchInfo &launch_info); - - static Status LaunchProcessPosixSpawn(const char *exe_path, - const ProcessLaunchInfo &launch_info, - lldb::pid_t &pid); - - static bool AddPosixSpawnFileAction(void *file_actions, - const FileAction *info, Log *log, - Status &error); - -#endif - static const lldb::UnixSignalsSP &GetUnixSignals(); static Status LaunchProcess(ProcessLaunchInfo &launch_info); @@ -246,5 +242,14 @@ public: } // namespace lldb_private +namespace llvm { +template <> struct format_provider<lldb_private::WaitStatus> { + /// Options = "" gives a human readable description of the status + /// Options = "g" gives a gdb-remote protocol status (e.g., X09) + static void format(const lldb_private::WaitStatus &WS, raw_ostream &OS, + llvm::StringRef Options); +}; +} // namespace llvm + #endif // #if defined(__cplusplus) #endif // liblldb_Host_h_ diff --git a/include/lldb/Host/common/NativeProcessProtocol.h b/include/lldb/Host/common/NativeProcessProtocol.h index 55eca0fa0b650..c43299a1df3d2 100644 --- a/include/lldb/Host/common/NativeProcessProtocol.h +++ b/include/lldb/Host/common/NativeProcessProtocol.h @@ -11,6 +11,7 @@ #define liblldb_NativeProcessProtocol_h_ #include "lldb/Core/TraceOptions.h" +#include "lldb/Host/Host.h" #include "lldb/Host/MainLoop.h" #include "lldb/Utility/Status.h" #include "lldb/lldb-private-forward.h" @@ -158,12 +159,9 @@ public: //---------------------------------------------------------------------- // Exit Status //---------------------------------------------------------------------- - virtual bool GetExitStatus(lldb_private::ExitType *exit_type, int *status, - std::string &exit_description); + virtual llvm::Optional<WaitStatus> GetExitStatus(); - virtual bool SetExitStatus(lldb_private::ExitType exit_type, int status, - const char *exit_description, - bool bNotifyStateChange); + virtual bool SetExitStatus(WaitStatus status, bool bNotifyStateChange); //---------------------------------------------------------------------- // Access to threads @@ -421,9 +419,8 @@ protected: lldb::StateType m_state; mutable std::recursive_mutex m_state_mutex; - lldb_private::ExitType m_exit_type; - int m_exit_status; - std::string m_exit_description; + llvm::Optional<WaitStatus> m_exit_status; + std::recursive_mutex m_delegates_mutex; std::vector<NativeDelegate *> m_delegates; NativeBreakpointList m_breakpoint_list; diff --git a/include/lldb/Host/posix/ProcessLauncherPosix.h b/include/lldb/Host/posix/ProcessLauncherPosix.h deleted file mode 100644 index 4800c40660492..0000000000000 --- a/include/lldb/Host/posix/ProcessLauncherPosix.h +++ /dev/null @@ -1,24 +0,0 @@ -//===-- ProcessLauncherPosix.h ----------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef lldb_Host_posix_ProcessLauncherPosix_h_ -#define lldb_Host_posix_ProcessLauncherPosix_h_ - -#include "lldb/Host/ProcessLauncher.h" - -namespace lldb_private { - -class ProcessLauncherPosix : public ProcessLauncher { -public: - HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info, - Status &error) override; -}; -} - -#endif diff --git a/include/lldb/lldb-enumerations.h b/include/lldb/lldb-enumerations.h index f62b3cc0b19b7..3c60873f6796c 100644 --- a/include/lldb/lldb-enumerations.h +++ b/include/lldb/lldb-enumerations.h @@ -454,6 +454,8 @@ enum LanguageType { enum InstrumentationRuntimeType { eInstrumentationRuntimeTypeAddressSanitizer = 0x0000, eInstrumentationRuntimeTypeThreadSanitizer = 0x0001, + eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer = 0x0002, + eInstrumentationRuntimeTypeMainThreadChecker = 0x0003, eNumInstrumentationRuntimeTypes }; diff --git a/include/lldb/lldb-private-enumerations.h b/include/lldb/lldb-private-enumerations.h index 3322656652371..983ddf3d23d60 100644 --- a/include/lldb/lldb-private-enumerations.h +++ b/include/lldb/lldb-private-enumerations.h @@ -212,19 +212,6 @@ enum class LineStatus { }; //---------------------------------------------------------------------- -// Exit Type for inferior processes -//---------------------------------------------------------------------- -typedef enum ExitType { - eExitTypeInvalid, - eExitTypeExit, // The exit status represents the return code from normal - // program exit (i.e. WIFEXITED() was true) - eExitTypeSignal, // The exit status represents the signal number that caused - // the program to exit (i.e. WIFSIGNALED() was true) - eExitTypeStop, // The exit status represents the stop signal that caused the - // program to exit (i.e. WIFSTOPPED() was true) -} ExitType; - -//---------------------------------------------------------------------- // Boolean result of running a Type Validator //---------------------------------------------------------------------- enum class TypeValidatorResult : bool { Success = true, Failure = false }; |