diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-16 19:47:58 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-16 19:47:58 +0000 |
commit | b76161e41bc2c07cd47f9c61f875d1be95e26d10 (patch) | |
tree | d03c19ce10dec6419f97df1d4dac9d47eb88982f /include/lldb/Target | |
parent | 8b4000f13b303cc154136abc74c55670673e2a96 (diff) |
Notes
Diffstat (limited to 'include/lldb/Target')
-rw-r--r-- | include/lldb/Target/ABI.h | 6 | ||||
-rw-r--r-- | include/lldb/Target/DynamicLoader.h | 4 | ||||
-rw-r--r-- | include/lldb/Target/Language.h | 2 | ||||
-rw-r--r-- | include/lldb/Target/LanguageRuntime.h | 2 | ||||
-rw-r--r-- | include/lldb/Target/Memory.h | 6 | ||||
-rw-r--r-- | include/lldb/Target/ModuleCache.h | 28 | ||||
-rw-r--r-- | include/lldb/Target/ObjCLanguageRuntime.h | 2 | ||||
-rw-r--r-- | include/lldb/Target/PathMappingList.h | 2 | ||||
-rw-r--r-- | include/lldb/Target/Platform.h | 130 | ||||
-rw-r--r-- | include/lldb/Target/Process.h | 215 | ||||
-rw-r--r-- | include/lldb/Target/ProcessLaunchInfo.h | 2 | ||||
-rw-r--r-- | include/lldb/Target/ProcessStructReader.h | 4 | ||||
-rw-r--r-- | include/lldb/Target/RegisterContext.h | 4 | ||||
-rw-r--r-- | include/lldb/Target/StackFrame.h | 10 | ||||
-rw-r--r-- | include/lldb/Target/StructuredDataPlugin.h | 4 | ||||
-rw-r--r-- | include/lldb/Target/Target.h | 57 | ||||
-rw-r--r-- | include/lldb/Target/TargetList.h | 38 | ||||
-rw-r--r-- | include/lldb/Target/Thread.h | 24 | ||||
-rw-r--r-- | include/lldb/Target/ThreadSpec.h | 6 |
19 files changed, 274 insertions, 272 deletions
diff --git a/include/lldb/Target/ABI.h b/include/lldb/Target/ABI.h index 4b611d244e210..a8e08e1a800aa 100644 --- a/include/lldb/Target/ABI.h +++ b/include/lldb/Target/ABI.h @@ -16,7 +16,7 @@ // Project includes #include "lldb/Core/PluginInterface.h" #include "lldb/Symbol/UnwindPlan.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #include "lldb/lldb-private.h" #include "llvm/ADT/ArrayRef.h" @@ -77,8 +77,8 @@ public: bool persistent = true) const; // Set the Return value object in the current frame as though a function with - virtual Error SetReturnValueObject(lldb::StackFrameSP &frame_sp, - lldb::ValueObjectSP &new_value) = 0; + virtual Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, + lldb::ValueObjectSP &new_value) = 0; protected: // This is the method the ABI will call to actually calculate the return diff --git a/include/lldb/Target/DynamicLoader.h b/include/lldb/Target/DynamicLoader.h index ced6ef44000a5..b5890662d4e56 100644 --- a/include/lldb/Target/DynamicLoader.h +++ b/include/lldb/Target/DynamicLoader.h @@ -12,8 +12,8 @@ // Project includes #include "lldb/Core/PluginInterface.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" // for FileSpec +#include "lldb/Utility/Status.h" #include "lldb/Utility/UUID.h" #include "lldb/lldb-defines.h" // for LLDB_INVALID_ADDRESS #include "lldb/lldb-forward.h" // for ModuleSP, ThreadPlanSP @@ -213,7 +213,7 @@ public: /// \b true if it is currently ok to try and load a shared /// library into the process, \b false otherwise. //------------------------------------------------------------------ - virtual Error CanLoadImage() = 0; + virtual Status CanLoadImage() = 0; //------------------------------------------------------------------ /// Ask if the eh_frame information for the given SymbolContext should diff --git a/include/lldb/Target/Language.h b/include/lldb/Target/Language.h index bcf840f93edd3..f81679f78129a 100644 --- a/include/lldb/Target/Language.h +++ b/include/lldb/Target/Language.h @@ -199,7 +199,7 @@ public: // it should return an appropriate closure here virtual DumpValueObjectOptions::DeclPrintingHelper GetDeclPrintingHelper(); - virtual LazyBool IsLogicalTrue(ValueObject &valobj, Error &error); + virtual LazyBool IsLogicalTrue(ValueObject &valobj, Status &error); // for a ValueObject of some "reference type", if the value points to the // nil/null object, this method returns true diff --git a/include/lldb/Target/LanguageRuntime.h b/include/lldb/Target/LanguageRuntime.h index a57216e847943..98db941669c79 100644 --- a/include/lldb/Target/LanguageRuntime.h +++ b/include/lldb/Target/LanguageRuntime.h @@ -48,7 +48,7 @@ public: static SearchFilter * CreateFromStructuredData(Target &target, const StructuredData::Dictionary &data_dict, - Error &error); + Status &error); StructuredData::ObjectSP SerializeToStructuredData() override; diff --git a/include/lldb/Target/Memory.h b/include/lldb/Target/Memory.h index f0a4bc5881f0f..af6be15df9fb6 100644 --- a/include/lldb/Target/Memory.h +++ b/include/lldb/Target/Memory.h @@ -40,7 +40,7 @@ public: void Flush(lldb::addr_t addr, size_t size); - size_t Read(lldb::addr_t addr, void *dst, size_t dst_len, Error &error); + size_t Read(lldb::addr_t addr, void *dst, size_t dst_len, Status &error); uint32_t GetMemoryCacheLineSize() const { return m_L2_cache_line_byte_size; } @@ -135,7 +135,7 @@ public: void Clear(); lldb::addr_t AllocateMemory(size_t byte_size, uint32_t permissions, - Error &error); + Status &error); bool DeallocateMemory(lldb::addr_t ptr); @@ -143,7 +143,7 @@ protected: typedef std::shared_ptr<AllocatedBlock> AllocatedBlockSP; AllocatedBlockSP AllocatePage(uint32_t byte_size, uint32_t permissions, - uint32_t chunk_size, Error &error); + uint32_t chunk_size, Status &error); //------------------------------------------------------------------ // Classes that inherit from MemoryCache can see and modify these diff --git a/include/lldb/Target/ModuleCache.h b/include/lldb/Target/ModuleCache.h index 49a7c97c60c31..4959ee8ea0a3f 100644 --- a/include/lldb/Target/ModuleCache.h +++ b/include/lldb/Target/ModuleCache.h @@ -14,8 +14,8 @@ #include "lldb/lldb-types.h" #include "lldb/Host/File.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/Status.h" #include <functional> #include <string> @@ -49,24 +49,24 @@ class UUID; class ModuleCache { public: using ModuleDownloader = - std::function<Error(const ModuleSpec &, const FileSpec &)>; + std::function<Status(const ModuleSpec &, const FileSpec &)>; using SymfileDownloader = - std::function<Error(const lldb::ModuleSP &, const FileSpec &)>; + std::function<Status(const lldb::ModuleSP &, const FileSpec &)>; - Error GetAndPut(const FileSpec &root_dir_spec, const char *hostname, - const ModuleSpec &module_spec, - const ModuleDownloader &module_downloader, - const SymfileDownloader &symfile_downloader, - lldb::ModuleSP &cached_module_sp, bool *did_create_ptr); + Status GetAndPut(const FileSpec &root_dir_spec, const char *hostname, + const ModuleSpec &module_spec, + const ModuleDownloader &module_downloader, + const SymfileDownloader &symfile_downloader, + lldb::ModuleSP &cached_module_sp, bool *did_create_ptr); private: - Error Put(const FileSpec &root_dir_spec, const char *hostname, - const ModuleSpec &module_spec, const FileSpec &tmp_file, - const FileSpec &target_file); + Status Put(const FileSpec &root_dir_spec, const char *hostname, + const ModuleSpec &module_spec, const FileSpec &tmp_file, + const FileSpec &target_file); - Error Get(const FileSpec &root_dir_spec, const char *hostname, - const ModuleSpec &module_spec, lldb::ModuleSP &cached_module_sp, - bool *did_create_ptr); + Status Get(const FileSpec &root_dir_spec, const char *hostname, + const ModuleSpec &module_spec, lldb::ModuleSP &cached_module_sp, + bool *did_create_ptr); std::unordered_map<std::string, lldb::ModuleWP> m_loaded_modules; }; diff --git a/include/lldb/Target/ObjCLanguageRuntime.h b/include/lldb/Target/ObjCLanguageRuntime.h index 0a9ffa933bd11..97a2a731581a8 100644 --- a/include/lldb/Target/ObjCLanguageRuntime.h +++ b/include/lldb/Target/ObjCLanguageRuntime.h @@ -168,7 +168,7 @@ public: bool EvaluatePrecondition(StoppointCallbackContext &context) override; void GetDescription(Stream &stream, lldb::DescriptionLevel level) override; - Error ConfigurePrecondition(Args &args) override; + Status ConfigurePrecondition(Args &args) override; protected: void AddClassName(const char *class_name); diff --git a/include/lldb/Target/PathMappingList.h b/include/lldb/Target/PathMappingList.h index 2b844882e4ad0..b1b551f2d24d9 100644 --- a/include/lldb/Target/PathMappingList.h +++ b/include/lldb/Target/PathMappingList.h @@ -16,7 +16,7 @@ #include <vector> // Other libraries and framework includes #include "lldb/Utility/ConstString.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" // Project includes namespace lldb_private { diff --git a/include/lldb/Target/Platform.h b/include/lldb/Target/Platform.h index fb05d3e06dd52..cc007d959c655 100644 --- a/include/lldb/Target/Platform.h +++ b/include/lldb/Target/Platform.h @@ -111,10 +111,10 @@ public: // Find an existing platform plug-in by name static lldb::PlatformSP Find(const ConstString &name); - static lldb::PlatformSP Create(const ConstString &name, Error &error); + static lldb::PlatformSP Create(const ConstString &name, Status &error); static lldb::PlatformSP Create(const ArchSpec &arch, - ArchSpec *platform_arch_ptr, Error &error); + ArchSpec *platform_arch_ptr, Status &error); static uint32_t GetNumConnectedRemotePlatforms(); @@ -156,9 +156,9 @@ public: /// Returns \b true if this Platform plug-in was able to find /// a suitable executable, \b false otherwise. //------------------------------------------------------------------ - virtual Error ResolveExecutable(const ModuleSpec &module_spec, - lldb::ModuleSP &module_sp, - const FileSpecList *module_search_paths_ptr); + virtual Status ResolveExecutable(const ModuleSpec &module_spec, + lldb::ModuleSP &module_sp, + const FileSpecList *module_search_paths_ptr); //------------------------------------------------------------------ /// Find a symbol file given a symbol file module specification. @@ -207,8 +207,8 @@ public: /// @return /// Returns an error that describes success or failure. //------------------------------------------------------------------ - virtual Error ResolveSymbolFile(Target &target, const ModuleSpec &sym_spec, - FileSpec &sym_file); + virtual Status ResolveSymbolFile(Target &target, const ModuleSpec &sym_spec, + FileSpec &sym_file); //------------------------------------------------------------------ /// Resolves the FileSpec to a (possibly) remote path. Remote @@ -316,8 +316,8 @@ public: /// @return /// An error object. //------------------------------------------------------------------ - virtual Error GetFileWithUUID(const FileSpec &platform_file, - const UUID *uuid_ptr, FileSpec &local_file); + virtual Status GetFileWithUUID(const FileSpec &platform_file, + const UUID *uuid_ptr, FileSpec &local_file); //---------------------------------------------------------------------- // Locate the scripting resource given a module specification. @@ -329,18 +329,18 @@ public: LocateExecutableScriptingResources(Target *target, Module &module, Stream *feedback_stream); - virtual Error GetSharedModule(const ModuleSpec &module_spec, Process *process, - lldb::ModuleSP &module_sp, - const FileSpecList *module_search_paths_ptr, - lldb::ModuleSP *old_module_sp_ptr, - bool *did_create_ptr); + virtual Status GetSharedModule(const ModuleSpec &module_spec, + Process *process, lldb::ModuleSP &module_sp, + const FileSpecList *module_search_paths_ptr, + lldb::ModuleSP *old_module_sp_ptr, + bool *did_create_ptr); virtual bool GetModuleSpec(const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec); - virtual Error ConnectRemote(Args &args); + virtual Status ConnectRemote(Args &args); - virtual Error DisconnectRemote(); + virtual Status DisconnectRemote(); //------------------------------------------------------------------ /// Get the platform's supported architectures in the order in which @@ -367,7 +367,7 @@ public: /// Launch a new process on a platform, not necessarily for /// debugging, it could be just for running the process. //------------------------------------------------------------------ - virtual Error LaunchProcess(ProcessLaunchInfo &launch_info); + virtual Status LaunchProcess(ProcessLaunchInfo &launch_info); //------------------------------------------------------------------ /// Perform expansion of the command-line for this launch info @@ -376,12 +376,12 @@ public: // argument magic the platform defines as part of its typical // user experience //------------------------------------------------------------------ - virtual Error ShellExpandArguments(ProcessLaunchInfo &launch_info); + virtual Status ShellExpandArguments(ProcessLaunchInfo &launch_info); //------------------------------------------------------------------ /// Kill process on a platform. //------------------------------------------------------------------ - virtual Error KillProcess(const lldb::pid_t pid); + virtual Status KillProcess(const lldb::pid_t pid); //------------------------------------------------------------------ /// Lets a platform answer if it is compatible with a given @@ -411,13 +411,13 @@ public: DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger, Target *target, // Can be nullptr, if nullptr create a new // target, else use existing one - Error &error); + Status &error); virtual lldb::ProcessSP ConnectProcess(llvm::StringRef connect_url, llvm::StringRef plugin_name, lldb_private::Debugger &debugger, lldb_private::Target *target, - lldb_private::Error &error); + lldb_private::Status &error); //------------------------------------------------------------------ /// Attach to an existing process using a process ID. @@ -442,7 +442,7 @@ public: Target *target, // Can be nullptr, if nullptr // create a new target, else // use existing one - Error &error) = 0; + Status &error) = 0; //------------------------------------------------------------------ /// Attach to an existing process by process name. @@ -464,7 +464,7 @@ public: // virtual lldb::ProcessSP // Attach (const char *process_name, // bool wait_for_launch, - // Error &error) = 0; + // Status &error) = 0; //------------------------------------------------------------------ // The base class Platform will take care of the host platform. @@ -552,27 +552,27 @@ public: return false; } - virtual Error MakeDirectory(const FileSpec &file_spec, uint32_t permissions); + virtual Status MakeDirectory(const FileSpec &file_spec, uint32_t permissions); - virtual Error GetFilePermissions(const FileSpec &file_spec, - uint32_t &file_permissions); + virtual Status GetFilePermissions(const FileSpec &file_spec, + uint32_t &file_permissions); - virtual Error SetFilePermissions(const FileSpec &file_spec, - uint32_t file_permissions); + virtual Status SetFilePermissions(const FileSpec &file_spec, + uint32_t file_permissions); virtual lldb::user_id_t OpenFile(const FileSpec &file_spec, uint32_t flags, - uint32_t mode, Error &error) { + uint32_t mode, Status &error) { return UINT64_MAX; } - virtual bool CloseFile(lldb::user_id_t fd, Error &error) { return false; } + virtual bool CloseFile(lldb::user_id_t fd, Status &error) { return false; } virtual lldb::user_id_t GetFileSize(const FileSpec &file_spec) { return UINT64_MAX; } virtual uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst, - uint64_t dst_len, Error &error) { + uint64_t dst_len, Status &error) { error.SetErrorStringWithFormat( "Platform::ReadFile() is not supported in the %s platform", GetName().GetCString()); @@ -580,19 +580,19 @@ public: } virtual uint64_t WriteFile(lldb::user_id_t fd, uint64_t offset, - const void *src, uint64_t src_len, Error &error) { + const void *src, uint64_t src_len, Status &error) { error.SetErrorStringWithFormat( "Platform::ReadFile() is not supported in the %s platform", GetName().GetCString()); return -1; } - virtual Error GetFile(const FileSpec &source, const FileSpec &destination); + virtual Status GetFile(const FileSpec &source, const FileSpec &destination); - virtual Error PutFile(const FileSpec &source, const FileSpec &destination, - uint32_t uid = UINT32_MAX, uint32_t gid = UINT32_MAX); + virtual Status PutFile(const FileSpec &source, const FileSpec &destination, + uint32_t uid = UINT32_MAX, uint32_t gid = UINT32_MAX); - virtual Error + virtual Status CreateSymlink(const FileSpec &src, // The name of the link is in src const FileSpec &dst); // The symlink points to dst @@ -620,13 +620,13 @@ public: /// @return /// An error object that describes anything that went wrong. //---------------------------------------------------------------------- - virtual Error Install(const FileSpec &src, const FileSpec &dst); + virtual Status Install(const FileSpec &src, const FileSpec &dst); virtual size_t GetEnvironment(StringList &environment); virtual bool GetFileExists(const lldb_private::FileSpec &file_spec); - virtual Error Unlink(const FileSpec &file_spec); + virtual Status Unlink(const FileSpec &file_spec); virtual uint64_t ConvertMmapFlagsToPlatform(const ArchSpec &arch, unsigned flags); @@ -664,7 +664,7 @@ public: return nullptr; } - virtual lldb_private::Error RunShellCommand( + virtual lldb_private::Status RunShellCommand( const char *command, // Shouldn't be nullptr const FileSpec &working_dir, // Pass empty FileSpec to use the current // working directory @@ -830,14 +830,14 @@ public: uint32_t LoadImage(lldb_private::Process *process, const lldb_private::FileSpec &local_file, const lldb_private::FileSpec &remote_file, - lldb_private::Error &error); + lldb_private::Status &error); virtual uint32_t DoLoadImage(lldb_private::Process *process, const lldb_private::FileSpec &remote_file, - lldb_private::Error &error); + lldb_private::Status &error); - virtual Error UnloadImage(lldb_private::Process *process, - uint32_t image_token); + virtual Status UnloadImage(lldb_private::Process *process, + uint32_t image_token); //------------------------------------------------------------------ /// Connect to all processes waiting for a debugger to attach @@ -856,7 +856,7 @@ public: /// The number of processes we are successfully connected to. //------------------------------------------------------------------ virtual size_t ConnectToWaitingProcesses(lldb_private::Debugger &debugger, - lldb_private::Error &error); + lldb_private::Status &error); protected: bool m_is_host; @@ -977,35 +977,35 @@ protected: m_gid_map.clear(); } - Error GetCachedExecutable(ModuleSpec &module_spec, lldb::ModuleSP &module_sp, - const FileSpecList *module_search_paths_ptr, - Platform &remote_platform); + Status GetCachedExecutable(ModuleSpec &module_spec, lldb::ModuleSP &module_sp, + const FileSpecList *module_search_paths_ptr, + Platform &remote_platform); - virtual Error DownloadModuleSlice(const FileSpec &src_file_spec, - const uint64_t src_offset, - const uint64_t src_size, - const FileSpec &dst_file_spec); + virtual Status DownloadModuleSlice(const FileSpec &src_file_spec, + const uint64_t src_offset, + const uint64_t src_size, + const FileSpec &dst_file_spec); - virtual Error DownloadSymbolFile(const lldb::ModuleSP &module_sp, - const FileSpec &dst_file_spec); + virtual Status DownloadSymbolFile(const lldb::ModuleSP &module_sp, + const FileSpec &dst_file_spec); virtual const char *GetCacheHostname(); private: - typedef std::function<Error(const ModuleSpec &)> ModuleResolver; + typedef std::function<Status(const ModuleSpec &)> ModuleResolver; - Error GetRemoteSharedModule(const ModuleSpec &module_spec, Process *process, - lldb::ModuleSP &module_sp, - const ModuleResolver &module_resolver, - bool *did_create_ptr); + Status GetRemoteSharedModule(const ModuleSpec &module_spec, Process *process, + lldb::ModuleSP &module_sp, + const ModuleResolver &module_resolver, + bool *did_create_ptr); bool GetCachedSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, bool *did_create_ptr); - Error LoadCachedExecutable(const ModuleSpec &module_spec, - lldb::ModuleSP &module_sp, - const FileSpecList *module_search_paths_ptr, - Platform &remote_platform); + Status LoadCachedExecutable(const ModuleSpec &module_spec, + lldb::ModuleSP &module_sp, + const FileSpecList *module_search_paths_ptr, + Platform &remote_platform); FileSpec GetModuleCacheRoot(); @@ -1088,7 +1088,7 @@ public: ~OptionGroupPlatformRSync() override = default; - lldb_private::Error + lldb_private::Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override; @@ -1117,7 +1117,7 @@ public: ~OptionGroupPlatformSSH() override = default; - lldb_private::Error + lldb_private::Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override; @@ -1144,7 +1144,7 @@ public: ~OptionGroupPlatformCaching() override = default; - lldb_private::Error + lldb_private::Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override; diff --git a/include/lldb/Target/Process.h b/include/lldb/Target/Process.h index 9a749efa7ae12..d2ab85d1652a0 100644 --- a/include/lldb/Target/Process.h +++ b/include/lldb/Target/Process.h @@ -48,8 +48,8 @@ #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/QueueList.h" #include "lldb/Target/ThreadList.h" -#include "lldb/Utility/Error.h" #include "lldb/Utility/NameMatches.h" +#include "lldb/Utility/Status.h" #include "lldb/lldb-private.h" #include "llvm/ADT/ArrayRef.h" @@ -282,8 +282,8 @@ public: ~ProcessLaunchCommandOptions() override = default; - Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, - ExecutionContext *execution_context) override; + Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, + ExecutionContext *execution_context) override; void OptionParsingStarting(ExecutionContext *execution_context) override { launch_info.Clear(); @@ -792,12 +792,12 @@ public: /// An error object. Call GetID() to get the process ID if /// the error object is success. //------------------------------------------------------------------ - virtual Error Launch(ProcessLaunchInfo &launch_info); + virtual Status Launch(ProcessLaunchInfo &launch_info); - virtual Error LoadCore(); + virtual Status LoadCore(); - virtual Error DoLoadCore() { - Error error; + virtual Status DoLoadCore() { + Status error; error.SetErrorStringWithFormat( "error: %s does not support loading core files.", GetPluginName().GetCString()); @@ -869,7 +869,7 @@ public: /// Returns \a pid if attaching was successful, or /// LLDB_INVALID_PROCESS_ID if attaching fails. //------------------------------------------------------------------ - virtual Error Attach(ProcessAttachInfo &attach_info); + virtual Status Attach(ProcessAttachInfo &attach_info); //------------------------------------------------------------------ /// Attach to a remote system via a URL @@ -885,7 +885,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error ConnectRemote(Stream *strm, llvm::StringRef remote_url); + virtual Status ConnectRemote(Stream *strm, llvm::StringRef remote_url); bool GetShouldDetach() const { return m_should_detach; } @@ -992,9 +992,9 @@ public: /// @see Thread:Step() /// @see Thread:Suspend() //------------------------------------------------------------------ - Error Resume(); + Status Resume(); - Error ResumeSynchronous(Stream *stream); + Status ResumeSynchronous(Stream *stream); //------------------------------------------------------------------ /// Halts a running process. @@ -1016,7 +1016,7 @@ public: /// halted. /// otherwise the halt has failed. //------------------------------------------------------------------ - Error Halt(bool clear_thread_plans = false, bool use_run_lock = true); + Status Halt(bool clear_thread_plans = false, bool use_run_lock = true); //------------------------------------------------------------------ /// Detaches from a running or stopped process. @@ -1030,7 +1030,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - Error Detach(bool keep_stopped); + Status Detach(bool keep_stopped); //------------------------------------------------------------------ /// Kills the process and shuts down all threads that were spawned @@ -1050,7 +1050,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - Error Destroy(bool force_kill); + Status Destroy(bool force_kill); //------------------------------------------------------------------ /// Sends a process a UNIX signal \a signal. @@ -1061,7 +1061,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - Error Signal(int signal); + Status Signal(int signal); void SetUnixSignals(lldb::UnixSignalsSP &&signals_sp); @@ -1080,7 +1080,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error WillAttachToProcessWithID(lldb::pid_t pid) { return Error(); } + virtual Status WillAttachToProcessWithID(lldb::pid_t pid) { return Status(); } //------------------------------------------------------------------ /// Called before attaching to a process. @@ -1091,9 +1091,9 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error WillAttachToProcessWithName(const char *process_name, - bool wait_for_launch) { - return Error(); + virtual Status WillAttachToProcessWithName(const char *process_name, + bool wait_for_launch) { + return Status(); } //------------------------------------------------------------------ @@ -1110,8 +1110,8 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error DoConnectRemote(Stream *strm, llvm::StringRef remote_url) { - Error error; + virtual Status DoConnectRemote(Stream *strm, llvm::StringRef remote_url) { + Status error; error.SetErrorString("remote connections are not supported"); return error; } @@ -1127,14 +1127,14 @@ public: /// will return the uid to attach as. /// /// @return - /// Returns a successful Error attaching was successful, or + /// Returns a successful Status attaching was successful, or /// an appropriate (possibly platform-specific) error code if /// attaching fails. /// hanming : need flag //------------------------------------------------------------------ - virtual Error DoAttachToProcessWithID(lldb::pid_t pid, - const ProcessAttachInfo &attach_info) { - Error error; + virtual Status DoAttachToProcessWithID(lldb::pid_t pid, + const ProcessAttachInfo &attach_info) { + Status error; error.SetErrorStringWithFormat( "error: %s does not support attaching to a process by pid", GetPluginName().GetCString()); @@ -1152,14 +1152,14 @@ public: /// will return the uid to attach as. /// /// @return - /// Returns a successful Error attaching was successful, or + /// Returns a successful Status attaching was successful, or /// an appropriate (possibly platform-specific) error code if /// attaching fails. //------------------------------------------------------------------ - virtual Error + virtual Status DoAttachToProcessWithName(const char *process_name, const ProcessAttachInfo &attach_info) { - Error error; + Status error; error.SetErrorString("attach by name is not supported"); return error; } @@ -1202,7 +1202,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error WillLaunch(Module *module) { return Error(); } + virtual Status WillLaunch(Module *module) { return Status(); } //------------------------------------------------------------------ /// Launch a new process. @@ -1220,11 +1220,11 @@ public: /// requested launch. /// /// @return - /// An Error instance indicating success or failure of the + /// An Status instance indicating success or failure of the /// operation. //------------------------------------------------------------------ - virtual Error DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) { - Error error; + virtual Status DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) { + Status error; error.SetErrorStringWithFormat( "error: %s does not support launching processes", GetPluginName().GetCString()); @@ -1248,7 +1248,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error WillResume() { return Error(); } + virtual Status WillResume() { return Status(); } //------------------------------------------------------------------ /// Resumes all of a process's threads as configured using the @@ -1267,8 +1267,8 @@ public: /// @see Thread:Step() /// @see Thread:Suspend() //------------------------------------------------------------------ - virtual Error DoResume() { - Error error; + virtual Status DoResume() { + Status error; error.SetErrorStringWithFormat( "error: %s does not support resuming processes", GetPluginName().GetCString()); @@ -1292,7 +1292,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error WillHalt() { return Error(); } + virtual Status WillHalt() { return Status(); } //------------------------------------------------------------------ /// Halts a running process. @@ -1314,8 +1314,8 @@ public: /// Returns \b true if the process successfully halts, \b false /// otherwise. //------------------------------------------------------------------ - virtual Error DoHalt(bool &caused_stop) { - Error error; + virtual Status DoHalt(bool &caused_stop) { + Status error; error.SetErrorStringWithFormat( "error: %s does not support halting processes", GetPluginName().GetCString()); @@ -1339,7 +1339,7 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error WillDetach() { return Error(); } + virtual Status WillDetach() { return Status(); } //------------------------------------------------------------------ /// Detaches from a running or stopped process. @@ -1348,8 +1348,8 @@ public: /// Returns \b true if the process successfully detaches, \b /// false otherwise. //------------------------------------------------------------------ - virtual Error DoDetach(bool keep_stopped) { - Error error; + virtual Status DoDetach(bool keep_stopped) { + Status error; error.SetErrorStringWithFormat( "error: %s does not support detaching from processes", GetPluginName().GetCString()); @@ -1377,7 +1377,7 @@ public: /// Process::DoSignal(int), otherwise an error describing what /// prevents the signal from being sent. //------------------------------------------------------------------ - virtual Error WillSignal() { return Error(); } + virtual Status WillSignal() { return Status(); } //------------------------------------------------------------------ /// Sends a process a UNIX signal \a signal. @@ -1385,17 +1385,17 @@ public: /// @return /// Returns an error object. //------------------------------------------------------------------ - virtual Error DoSignal(int signal) { - Error error; + virtual Status DoSignal(int signal) { + Status error; error.SetErrorStringWithFormat( "error: %s does not support sending signals to processes", GetPluginName().GetCString()); return error; } - virtual Error WillDestroy() { return Error(); } + virtual Status WillDestroy() { return Status(); } - virtual Error DoDestroy() = 0; + virtual Status DoDestroy() = 0; virtual void DidDestroy() {} @@ -1706,7 +1706,7 @@ public: /// The number of bytes that were actually read into \a buf. //------------------------------------------------------------------ virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, - Error &error) = 0; + Status &error) = 0; //------------------------------------------------------------------ /// Read of memory from a process. @@ -1738,7 +1738,7 @@ public: /// returned to indicate an error. //------------------------------------------------------------------ virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, - Error &error); + Status &error); //------------------------------------------------------------------ /// Read a NULL terminated string from memory @@ -1770,7 +1770,7 @@ public: /// The error status or the number of bytes prior to the null terminator. //------------------------------------------------------------------ size_t ReadStringFromMemory(lldb::addr_t vm_addr, char *str, size_t max_bytes, - Error &error, size_t type_width = 1); + Status &error, size_t type_width = 1); //------------------------------------------------------------------ /// Read a NULL terminated C string from memory @@ -1782,13 +1782,13 @@ public: /// terminated (at most cstr_max_len - 1 bytes will be read). //------------------------------------------------------------------ size_t ReadCStringFromMemory(lldb::addr_t vm_addr, char *cstr, - size_t cstr_max_len, Error &error); + size_t cstr_max_len, Status &error); size_t ReadCStringFromMemory(lldb::addr_t vm_addr, std::string &out_str, - Error &error); + Status &error); size_t ReadMemoryFromInferior(lldb::addr_t vm_addr, void *buf, size_t size, - Error &error); + Status &error); //------------------------------------------------------------------ /// Reads an unsigned integer of the specified byte size from @@ -1819,15 +1819,15 @@ public: //------------------------------------------------------------------ uint64_t ReadUnsignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, uint64_t fail_value, - Error &error); + Status &error); int64_t ReadSignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, - int64_t fail_value, Error &error); + int64_t fail_value, Status &error); - lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Error &error); + lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error); bool WritePointerToMemory(lldb::addr_t vm_addr, lldb::addr_t ptr_value, - Error &error); + Status &error); //------------------------------------------------------------------ /// Actually do the writing of memory to a process. @@ -1850,7 +1850,7 @@ public: /// The number of bytes that were actually written. //------------------------------------------------------------------ virtual size_t DoWriteMemory(lldb::addr_t vm_addr, const void *buf, - size_t size, Error &error) { + size_t size, Status &error) { error.SetErrorStringWithFormat( "error: %s does not support writing to processes", GetPluginName().GetCString()); @@ -1890,11 +1890,11 @@ public: /// The number of bytes that were actually written. //------------------------------------------------------------------ size_t WriteScalarToMemory(lldb::addr_t vm_addr, const Scalar &scalar, - size_t size, Error &error); + size_t size, Status &error); size_t ReadScalarIntegerFromMemory(lldb::addr_t addr, uint32_t byte_size, bool is_signed, Scalar &scalar, - Error &error); + Status &error); //------------------------------------------------------------------ /// Write memory to a process. @@ -1923,7 +1923,7 @@ public: //------------------------------------------------------------------ // TODO: change this to take an ArrayRef<uint8_t> size_t WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, - Error &error); + Status &error); //------------------------------------------------------------------ /// Actually allocate memory in the process. @@ -1941,7 +1941,7 @@ public: //------------------------------------------------------------------ virtual lldb::addr_t DoAllocateMemory(size_t size, uint32_t permissions, - Error &error) { + Status &error) { error.SetErrorStringWithFormat( "error: %s does not support allocating in the debug process", GetPluginName().GetCString()); @@ -1971,7 +1971,7 @@ public: /// The address of the allocated buffer in the process, or /// LLDB_INVALID_ADDRESS if the allocation failed. //------------------------------------------------------------------ - lldb::addr_t AllocateMemory(size_t size, uint32_t permissions, Error &error); + lldb::addr_t AllocateMemory(size_t size, uint32_t permissions, Status &error); //------------------------------------------------------------------ /// The public interface to allocating memory in the process, this also @@ -1998,7 +1998,8 @@ public: /// LLDB_INVALID_ADDRESS if the allocation failed. //------------------------------------------------------------------ - lldb::addr_t CallocateMemory(size_t size, uint32_t permissions, Error &error); + lldb::addr_t CallocateMemory(size_t size, uint32_t permissions, + Status &error); //------------------------------------------------------------------ /// Resolve dynamically loaded indirect functions. @@ -2014,7 +2015,7 @@ public: /// LLDB_INVALID_ADDRESS if the resolution failed. //------------------------------------------------------------------ virtual lldb::addr_t ResolveIndirectFunction(const Address *address, - Error &error); + Status &error); //------------------------------------------------------------------ /// Locate the memory region that contains load_addr. @@ -2042,9 +2043,9 @@ public: /// @return /// An error value. //------------------------------------------------------------------ - virtual Error GetMemoryRegionInfo(lldb::addr_t load_addr, - MemoryRegionInfo &range_info) { - Error error; + virtual Status GetMemoryRegionInfo(lldb::addr_t load_addr, + MemoryRegionInfo &range_info) { + Status error; error.SetErrorString("Process::GetMemoryRegionInfo() not supported"); return error; } @@ -2059,18 +2060,18 @@ public: /// @return /// An error value. //------------------------------------------------------------------ - virtual Error + virtual Status GetMemoryRegions(std::vector<lldb::MemoryRegionInfoSP> ®ion_list); - virtual Error GetWatchpointSupportInfo(uint32_t &num) { - Error error; + virtual Status GetWatchpointSupportInfo(uint32_t &num) { + Status error; num = 0; error.SetErrorString("Process::GetWatchpointSupportInfo() not supported"); return error; } - virtual Error GetWatchpointSupportInfo(uint32_t &num, bool &after) { - Error error; + virtual Status GetWatchpointSupportInfo(uint32_t &num, bool &after) { + Status error; num = 0; after = true; error.SetErrorString("Process::GetWatchpointSupportInfo() not supported"); @@ -2165,8 +2166,8 @@ public: /// @return /// \btrue if the memory was deallocated, \bfalse otherwise. //------------------------------------------------------------------ - virtual Error DoDeallocateMemory(lldb::addr_t ptr) { - Error error; + virtual Status DoDeallocateMemory(lldb::addr_t ptr) { + Status error; error.SetErrorStringWithFormat( "error: %s does not support deallocating in the debug process", GetPluginName().GetCString()); @@ -2186,7 +2187,7 @@ public: /// @return /// \btrue if the memory was deallocated, \bfalse otherwise. //------------------------------------------------------------------ - Error DeallocateMemory(lldb::addr_t ptr); + Status DeallocateMemory(lldb::addr_t ptr); //------------------------------------------------------------------ /// Get any available STDOUT. @@ -2218,7 +2219,7 @@ public: /// equal to \a buf_size, another call to this function should /// be made to retrieve more STDOUT data. //------------------------------------------------------------------ - virtual size_t GetSTDOUT(char *buf, size_t buf_size, Error &error); + virtual size_t GetSTDOUT(char *buf, size_t buf_size, Status &error); //------------------------------------------------------------------ /// Get any available STDERR. @@ -2250,7 +2251,7 @@ public: /// equal to \a buf_size, another call to this function should /// be made to retrieve more STDERR data. //------------------------------------------------------------------ - virtual size_t GetSTDERR(char *buf, size_t buf_size, Error &error); + virtual size_t GetSTDERR(char *buf, size_t buf_size, Status &error); //------------------------------------------------------------------ /// Puts data into this process's STDIN. @@ -2273,7 +2274,7 @@ public: /// less than \a buf_size, another call to this function should /// be made to write the rest of the data. //------------------------------------------------------------------ - virtual size_t PutSTDIN(const char *buf, size_t buf_size, Error &error) { + virtual size_t PutSTDIN(const char *buf, size_t buf_size, Status &error) { error.SetErrorString("stdin unsupported"); return 0; } @@ -2293,23 +2294,23 @@ public: /// equal to \a buf_size, another call to this function should /// be made to retrieve more profile data. //------------------------------------------------------------------ - virtual size_t GetAsyncProfileData(char *buf, size_t buf_size, Error &error); + virtual size_t GetAsyncProfileData(char *buf, size_t buf_size, Status &error); //---------------------------------------------------------------------- // Process Breakpoints //---------------------------------------------------------------------- size_t GetSoftwareBreakpointTrapOpcode(BreakpointSite *bp_site); - virtual Error EnableBreakpointSite(BreakpointSite *bp_site) { - Error error; + virtual Status EnableBreakpointSite(BreakpointSite *bp_site) { + Status error; error.SetErrorStringWithFormat( "error: %s does not support enabling breakpoints", GetPluginName().GetCString()); return error; } - virtual Error DisableBreakpointSite(BreakpointSite *bp_site) { - Error error; + virtual Status DisableBreakpointSite(BreakpointSite *bp_site) { + Status error; error.SetErrorStringWithFormat( "error: %s does not support disabling breakpoints", GetPluginName().GetCString()); @@ -2320,13 +2321,13 @@ public: // don't need to implement this function unless the standard flow of // read existing opcode, write breakpoint opcode, verify breakpoint opcode // doesn't work for a specific process plug-in. - virtual Error EnableSoftwareBreakpoint(BreakpointSite *bp_site); + virtual Status EnableSoftwareBreakpoint(BreakpointSite *bp_site); // This is implemented completely using the lldb::Process API. Subclasses // don't need to implement this function unless the standard flow of // restoring original opcode in memory and verifying the restored opcode // doesn't work for a specific process plug-in. - virtual Error DisableSoftwareBreakpoint(BreakpointSite *bp_site); + virtual Status DisableSoftwareBreakpoint(BreakpointSite *bp_site); BreakpointSiteList &GetBreakpointSiteList(); @@ -2334,14 +2335,14 @@ public: void DisableAllBreakpointSites(); - Error ClearBreakpointSiteByID(lldb::user_id_t break_id); + Status ClearBreakpointSiteByID(lldb::user_id_t break_id); lldb::break_id_t CreateBreakpointSite(const lldb::BreakpointLocationSP &owner, bool use_hardware); - Error DisableBreakpointSiteByID(lldb::user_id_t break_id); + Status DisableBreakpointSiteByID(lldb::user_id_t break_id); - Error EnableBreakpointSiteByID(lldb::user_id_t break_id); + Status EnableBreakpointSiteByID(lldb::user_id_t break_id); // BreakpointLocations use RemoveOwnerFromBreakpointSite to remove // themselves from the owner's list of this breakpoint sites. @@ -2352,9 +2353,9 @@ public: //---------------------------------------------------------------------- // Process Watchpoints (optional) //---------------------------------------------------------------------- - virtual Error EnableWatchpoint(Watchpoint *wp, bool notify = true); + virtual Status EnableWatchpoint(Watchpoint *wp, bool notify = true); - virtual Error DisableWatchpoint(Watchpoint *wp, bool notify = true); + virtual Status DisableWatchpoint(Watchpoint *wp, bool notify = true); //------------------------------------------------------------------ // Thread Queries @@ -2613,8 +2614,8 @@ public: ProcessRunLock &GetRunLock(); - virtual Error SendEventData(const char *data) { - Error return_error("Sending an event is not supported for this process."); + virtual Status SendEventData(const char *data) { + Status return_error("Sending an event is not supported for this process."); return return_error; } @@ -2665,9 +2666,9 @@ public: /// The load address of the file if it is loaded into the /// processes address space, LLDB_INVALID_ADDRESS otherwise. //------------------------------------------------------------------ - virtual Error GetFileLoadAddress(const FileSpec &file, bool &is_loaded, - lldb::addr_t &load_addr) { - return Error("Not supported"); + virtual Status GetFileLoadAddress(const FileSpec &file, bool &is_loaded, + lldb::addr_t &load_addr) { + return Status("Not supported"); } size_t AddImageToken(lldb::addr_t image_ptr); @@ -2729,7 +2730,7 @@ public: /// @return /// Returns the result of attempting to configure the feature. //------------------------------------------------------------------ - virtual Error + virtual Status ConfigureStructuredData(const ConstString &type_name, const StructuredData::ObjectSP &config_sp); @@ -2781,7 +2782,7 @@ public: /// configuration. //------------------------------------------------------------------ virtual lldb::user_id_t StartTrace(lldb::TraceOptionsSP &options, - Error &error) { + Status &error) { error.SetErrorString("Not implemented"); return LLDB_INVALID_UID; } @@ -2796,7 +2797,7 @@ public: /// to be stopped a thread_id can be supplied. //------------------------------------------------------------------ virtual void StopTrace(lldb::user_id_t uid, lldb::tid_t thread_id, - Error &error) { + Status &error) { error.SetErrorString("Not implemented"); } @@ -2809,7 +2810,7 @@ public: /// thread for trace extraction. //------------------------------------------------------------------ virtual size_t GetData(lldb::user_id_t uid, lldb::tid_t thread_id, - Error &error, void *buf, size_t size, + Status &error, void *buf, size_t size, size_t offset = 0) { error.SetErrorString("Not implemented"); return 0; @@ -2819,7 +2820,7 @@ public: /// Similar API as above except for obtaining meta data //------------------------------------------------------------------ virtual size_t GetMetaData(lldb::user_id_t uid, lldb::tid_t thread_id, - Error &error, void *buf, size_t size, + Status &error, void *buf, size_t size, size_t offset = 0) { error.SetErrorString("Not implemented"); return 0; @@ -2834,7 +2835,7 @@ public: /// configuration used by a specific thread. The thread_id specified /// should also match the uid otherwise an error will be returned. //------------------------------------------------------------------ - virtual void GetTraceConfig(lldb::user_id_t uid, Error &error, + virtual void GetTraceConfig(lldb::user_id_t uid, Status &error, lldb::TraceOptionsSP &options) { error.SetErrorString("Not implemented"); return; @@ -2850,9 +2851,9 @@ protected: /// state of m_run_lock, but just causes the process to resume. /// /// @return - /// An Error object describing the success or failure of the resume. + /// An Status object describing the success or failure of the resume. //------------------------------------------------------------------ - Error PrivateResume(); + Status PrivateResume(); //------------------------------------------------------------------ // Called internally @@ -3179,7 +3180,7 @@ private: protected: void HandlePrivateEvent(lldb::EventSP &event_sp); - Error HaltPrivate(); + Status HaltPrivate(); lldb::StateType WaitForProcessStopPrivate(lldb::EventSP &event_sp, const Timeout<std::micro> &timeout); @@ -3196,7 +3197,7 @@ protected: const Timeout<std::micro> &timeout); size_t WriteMemoryPrivate(lldb::addr_t addr, const void *buf, size_t size, - Error &error); + Status &error); void AppendSTDOUT(const char *s, size_t len); @@ -3217,9 +3218,9 @@ protected: return static_cast<bool>(m_process_input_reader); } - Error StopForDestroyOrDetach(lldb::EventSP &exit_event_sp); + Status StopForDestroyOrDetach(lldb::EventSP &exit_event_sp); - virtual Error UpdateAutomaticSignalFiltering(); + virtual Status UpdateAutomaticSignalFiltering(); bool StateChangedIsExternallyHijacked(); diff --git a/include/lldb/Target/ProcessLaunchInfo.h b/include/lldb/Target/ProcessLaunchInfo.h index 083e0bbed8bde..93a1a9ebd2391 100644 --- a/include/lldb/Target/ProcessLaunchInfo.h +++ b/include/lldb/Target/ProcessLaunchInfo.h @@ -94,7 +94,7 @@ public: void Clear(); - bool ConvertArgumentsForLaunchingInShell(Error &error, bool localhost, + bool ConvertArgumentsForLaunchingInShell(Status &error, bool localhost, bool will_debug, bool first_arg_is_full_shell_command, int32_t num_resumes); diff --git a/include/lldb/Target/ProcessStructReader.h b/include/lldb/Target/ProcessStructReader.h index acc5c1f326869..cfc8fe11a39ab 100644 --- a/include/lldb/Target/ProcessStructReader.h +++ b/include/lldb/Target/ProcessStructReader.h @@ -17,7 +17,7 @@ #include "lldb/Target/Process.h" #include "lldb/Utility/ConstString.h" #include "lldb/Utility/DataExtractor.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #include <initializer_list> #include <map> @@ -68,7 +68,7 @@ public: } size_t total_size = struct_type.GetByteSize(nullptr); lldb::DataBufferSP buffer_sp(new DataBufferHeap(total_size, 0)); - Error error; + Status error; process->ReadMemoryFromInferior(base_addr, buffer_sp->GetBytes(), total_size, error); if (error.Fail()) diff --git a/include/lldb/Target/RegisterContext.h b/include/lldb/Target/RegisterContext.h index 485645b2dc148..c438a0cd12cfd 100644 --- a/include/lldb/Target/RegisterContext.h +++ b/include/lldb/Target/RegisterContext.h @@ -138,12 +138,12 @@ public: virtual bool HardwareSingleStep(bool enable); - virtual Error + virtual Status ReadRegisterValueFromMemory(const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue ®_value); - virtual Error + virtual Status WriteRegisterValueToMemory(const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue ®_value); diff --git a/include/lldb/Target/StackFrame.h b/include/lldb/Target/StackFrame.h index 1f25575e236a4..cb503875a5c0e 100644 --- a/include/lldb/Target/StackFrame.h +++ b/include/lldb/Target/StackFrame.h @@ -24,7 +24,7 @@ #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/ExecutionContextScope.h" #include "lldb/Target/StackID.h" -#include "lldb/Utility/Error.h" +#include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/UserID.h" @@ -201,7 +201,7 @@ public: /// Returns true if the CFA value was successfully set in value. Some /// frames may be unable to provide this value; they will return false. //------------------------------------------------------------------ - bool GetFrameBaseValue(Scalar &value, Error *error_ptr); + bool GetFrameBaseValue(Scalar &value, Status *error_ptr); //------------------------------------------------------------------ /// Get the DWARFExpression corresponding to the Canonical Frame Address. @@ -215,7 +215,7 @@ public: /// @return /// Returns the corresponding DWARF expression, or NULL. //------------------------------------------------------------------ - DWARFExpression *GetFrameBaseExpression(Error *error_ptr); + DWARFExpression *GetFrameBaseExpression(Status *error_ptr); //------------------------------------------------------------------ /// Get the current lexical scope block for this StackFrame, if possible. @@ -315,7 +315,7 @@ public: //------------------------------------------------------------------ lldb::ValueObjectSP GetValueForVariableExpressionPath( llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, - uint32_t options, lldb::VariableSP &var_sp, Error &error); + uint32_t options, lldb::VariableSP &var_sp, Status &error); //------------------------------------------------------------------ /// Determine whether this StackFrame has debug information available or not @@ -535,7 +535,7 @@ private: SymbolContext m_sc; Flags m_flags; Scalar m_frame_base; - Error m_frame_base_error; + Status m_frame_base_error; bool m_cfa_is_valid; // Does this frame have a CFA? Different from CFA == // LLDB_INVALID_ADDRESS uint32_t m_stop_id; diff --git a/include/lldb/Target/StructuredDataPlugin.h b/include/lldb/Target/StructuredDataPlugin.h index aa4452a9c3f20..a4d2c03826285 100644 --- a/include/lldb/Target/StructuredDataPlugin.h +++ b/include/lldb/Target/StructuredDataPlugin.h @@ -123,8 +123,8 @@ public: /// The error if formatting the object contents failed; otherwise, /// success. // ------------------------------------------------------------------------- - virtual Error GetDescription(const StructuredData::ObjectSP &object_sp, - lldb_private::Stream &stream) = 0; + virtual Status GetDescription(const StructuredData::ObjectSP &object_sp, + lldb_private::Stream &stream) = 0; // ------------------------------------------------------------------------- /// Returns whether the plugin's features are enabled. diff --git a/include/lldb/Target/Target.h b/include/lldb/Target/Target.h index 8aa263f592548..ff9451939909a 100644 --- a/include/lldb/Target/Target.h +++ b/include/lldb/Target/Target.h @@ -490,7 +490,7 @@ public: // UpdateInstanceName (); lldb::ModuleSP GetSharedModule(const ModuleSpec &module_spec, - Error *error_ptr = nullptr); + Status *error_ptr = nullptr); //---------------------------------------------------------------------- // Settings accessors @@ -528,11 +528,11 @@ public: void Destroy(); - Error Launch(ProcessLaunchInfo &launch_info, - Stream *stream); // Optional stream to receive first stop info + Status Launch(ProcessLaunchInfo &launch_info, + Stream *stream); // Optional stream to receive first stop info - Error Attach(ProcessAttachInfo &attach_info, - Stream *stream); // Optional stream to receive first stop info + Status Attach(ProcessAttachInfo &attach_info, + Stream *stream); // Optional stream to receive first stop info //------------------------------------------------------------------ // This part handles the breakpoints. @@ -611,7 +611,7 @@ public: CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp, bool throw_bp, bool internal, Args *additional_args = nullptr, - Error *additional_args_error = nullptr); + Status *additional_args_error = nullptr); // This is the same as the func_name breakpoint except that you can specify a // vector of names. This is cheaper @@ -644,7 +644,7 @@ public: // Use this to create a watchpoint: lldb::WatchpointSP CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *type, uint32_t kind, - Error &error); + Status &error); lldb::WatchpointSP GetLastCreatedWatchpoint() { return m_last_created_watchpoint; @@ -687,15 +687,16 @@ public: bool IgnoreWatchpointByID(lldb::watch_id_t watch_id, uint32_t ignore_count); - Error SerializeBreakpointsToFile(const FileSpec &file, - const BreakpointIDList &bp_ids, bool append); + Status SerializeBreakpointsToFile(const FileSpec &file, + const BreakpointIDList &bp_ids, + bool append); - Error CreateBreakpointsFromFile(const FileSpec &file, - BreakpointIDList &new_bps); + Status CreateBreakpointsFromFile(const FileSpec &file, + BreakpointIDList &new_bps); - Error CreateBreakpointsFromFile(const FileSpec &file, - std::vector<std::string> &names, - BreakpointIDList &new_bps); + Status CreateBreakpointsFromFile(const FileSpec &file, + std::vector<std::string> &names, + BreakpointIDList &new_bps); //------------------------------------------------------------------ /// Get \a load_addr as a callable code load address for this target @@ -808,7 +809,7 @@ public: //------------------------------------------------------------------ void SetExecutableModule(lldb::ModuleSP &module_sp, bool get_dependent_files); - bool LoadScriptingResources(std::list<Error> &errors, + bool LoadScriptingResources(std::list<Status> &errors, Stream *feedback_stream = nullptr, bool continue_on_error = true) { return m_images.LoadScriptingResourcesInTarget( @@ -914,7 +915,7 @@ public: Debugger &GetDebugger() { return m_debugger; } size_t ReadMemoryFromFileCache(const Address &addr, void *dst, size_t dst_len, - Error &error); + Status &error); // Reading memory through the target allows us to skip going to the process // for reading memory if possible and it allows us to try and read from @@ -927,27 +928,27 @@ public: // 2 - if there is a valid process, try and read from its memory // 3 - if (prefer_file_cache == false) then read from object file cache size_t ReadMemory(const Address &addr, bool prefer_file_cache, void *dst, - size_t dst_len, Error &error, + size_t dst_len, Status &error, lldb::addr_t *load_addr_ptr = nullptr); size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, - Error &error); + Status &error); size_t ReadCStringFromMemory(const Address &addr, char *dst, - size_t dst_max_len, Error &result_error); + size_t dst_max_len, Status &result_error); size_t ReadScalarIntegerFromMemory(const Address &addr, bool prefer_file_cache, uint32_t byte_size, bool is_signed, Scalar &scalar, - Error &error); + Status &error); uint64_t ReadUnsignedIntegerFromMemory(const Address &addr, bool prefer_file_cache, size_t integer_byte_size, - uint64_t fail_value, Error &error); + uint64_t fail_value, Status &error); bool ReadPointerFromMemory(const Address &addr, bool prefer_file_cache, - Error &error, Address &pointer_addr); + Status &error, Address &pointer_addr); SectionLoadList &GetSectionLoadList() { return m_section_load_history.GetCurrentSectionLoadList(); @@ -978,7 +979,7 @@ public: PathMappingList &GetImageSearchPathList(); - TypeSystem *GetScratchTypeSystemForLanguage(Error *error, + TypeSystem *GetScratchTypeSystemForLanguage(Status *error, lldb::LanguageType language, bool create_on_demand = true); @@ -993,7 +994,7 @@ public: UserExpression *GetUserExpressionForLanguage( llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, Expression::ResultType desired_type, - const EvaluateExpressionOptions &options, Error &error); + const EvaluateExpressionOptions &options, Status &error); // Creates a FunctionCaller for the given language, the rest of the parameters // have the @@ -1008,7 +1009,7 @@ public: const CompilerType &return_type, const Address &function_address, const ValueList &arg_value_list, - const char *name, Error &error); + const char *name, Status &error); // Creates a UtilityFunction for the given language, the rest of the // parameters have the @@ -1018,7 +1019,7 @@ public: UtilityFunction *GetUtilityFunctionForLanguage(const char *expr, lldb::LanguageType language, const char *name, - Error &error); + Status &error); ClangASTContext *GetScratchClangASTContext(bool create_on_demand = true); @@ -1028,7 +1029,7 @@ public: // Install any files through the platform that need be to installed // prior to launching or attaching. //---------------------------------------------------------------------- - Error Install(ProcessLaunchInfo *launch_info); + Status Install(ProcessLaunchInfo *launch_info); bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr); @@ -1183,7 +1184,7 @@ public: GetSearchFilterForModuleAndCUList(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles); - lldb::REPLSP GetREPL(Error &err, lldb::LanguageType language, + lldb::REPLSP GetREPL(Status &err, lldb::LanguageType language, const char *repl_options, bool can_create); void SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp); diff --git a/include/lldb/Target/TargetList.h b/include/lldb/Target/TargetList.h index 81b81dba7757d..43f4520369b6c 100644 --- a/include/lldb/Target/TargetList.h +++ b/include/lldb/Target/TargetList.h @@ -91,10 +91,10 @@ public: /// @return /// An error object that indicates success or failure //------------------------------------------------------------------ - Error CreateTarget(Debugger &debugger, llvm::StringRef user_exe_path, - llvm::StringRef triple_str, bool get_dependent_modules, - const OptionGroupPlatform *platform_options, - lldb::TargetSP &target_sp); + Status CreateTarget(Debugger &debugger, llvm::StringRef user_exe_path, + llvm::StringRef triple_str, bool get_dependent_modules, + const OptionGroupPlatform *platform_options, + lldb::TargetSP &target_sp); //------------------------------------------------------------------ /// Create a new Target. @@ -102,9 +102,9 @@ public: /// Same as the function above, but used when you already know the /// platform you will be using //------------------------------------------------------------------ - Error CreateTarget(Debugger &debugger, llvm::StringRef user_exe_path, - const ArchSpec &arch, bool get_dependent_modules, - lldb::PlatformSP &platform_sp, lldb::TargetSP &target_sp); + Status CreateTarget(Debugger &debugger, llvm::StringRef user_exe_path, + const ArchSpec &arch, bool get_dependent_modules, + lldb::PlatformSP &platform_sp, lldb::TargetSP &target_sp); //------------------------------------------------------------------ /// Delete a Target object from the list. @@ -211,20 +211,20 @@ protected: private: lldb::TargetSP GetDummyTarget(lldb_private::Debugger &debugger); - Error CreateDummyTarget(Debugger &debugger, - llvm::StringRef specified_arch_name, - lldb::TargetSP &target_sp); + Status CreateDummyTarget(Debugger &debugger, + llvm::StringRef specified_arch_name, + lldb::TargetSP &target_sp); - Error CreateTargetInternal(Debugger &debugger, llvm::StringRef user_exe_path, - llvm::StringRef triple_str, - bool get_dependent_files, - const OptionGroupPlatform *platform_options, - lldb::TargetSP &target_sp, bool is_dummy_target); + Status CreateTargetInternal(Debugger &debugger, llvm::StringRef user_exe_path, + llvm::StringRef triple_str, + bool get_dependent_files, + const OptionGroupPlatform *platform_options, + lldb::TargetSP &target_sp, bool is_dummy_target); - Error CreateTargetInternal(Debugger &debugger, llvm::StringRef user_exe_path, - const ArchSpec &arch, bool get_dependent_modules, - lldb::PlatformSP &platform_sp, - lldb::TargetSP &target_sp, bool is_dummy_target); + Status CreateTargetInternal(Debugger &debugger, llvm::StringRef user_exe_path, + const ArchSpec &arch, bool get_dependent_modules, + lldb::PlatformSP &platform_sp, + lldb::TargetSP &target_sp, bool is_dummy_target); DISALLOW_COPY_AND_ASSIGN(TargetList); }; diff --git a/include/lldb/Target/Thread.h b/include/lldb/Target/Thread.h index 47d0b7d767d64..cfab130692783 100644 --- a/include/lldb/Target/Thread.h +++ b/include/lldb/Target/Thread.h @@ -441,16 +441,16 @@ public: return GetStackFrameList()->GetCurrentInlinedDepth(); } - Error ReturnFromFrameWithIndex(uint32_t frame_idx, - lldb::ValueObjectSP return_value_sp, - bool broadcast = false); + Status ReturnFromFrameWithIndex(uint32_t frame_idx, + lldb::ValueObjectSP return_value_sp, + bool broadcast = false); - Error ReturnFromFrame(lldb::StackFrameSP frame_sp, - lldb::ValueObjectSP return_value_sp, - bool broadcast = false); + Status ReturnFromFrame(lldb::StackFrameSP frame_sp, + lldb::ValueObjectSP return_value_sp, + bool broadcast = false); - Error JumpToLine(const FileSpec &file, uint32_t line, bool can_leave_function, - std::string *warnings = nullptr); + Status JumpToLine(const FileSpec &file, uint32_t line, + bool can_leave_function, std::string *warnings = nullptr); virtual lldb::StackFrameSP GetFrameWithStackID(const StackID &stack_id) { if (stack_id.IsValid()) @@ -530,7 +530,7 @@ public: /// @return /// An error that describes anything that went wrong //------------------------------------------------------------------ - virtual Error + virtual Status StepIn(bool source_step, LazyBool step_in_avoids_code_without_debug_info = eLazyBoolCalculate, LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate); @@ -548,7 +548,7 @@ public: /// @return /// An error that describes anything that went wrong //------------------------------------------------------------------ - virtual Error StepOver( + virtual Status StepOver( bool source_step, LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate); @@ -561,7 +561,7 @@ public: /// @return /// An error that describes anything that went wrong //------------------------------------------------------------------ - virtual Error StepOut(); + virtual Status StepOut(); //------------------------------------------------------------------ /// Retrieves the per-thread data area. @@ -973,7 +973,7 @@ public: /// An error if the thread plan could not be unwound. //------------------------------------------------------------------ - Error UnwindInnermostExpression(); + Status UnwindInnermostExpression(); //------------------------------------------------------------------ /// Gets the outer-most plan that was popped off the plan stack in the diff --git a/include/lldb/Target/ThreadSpec.h b/include/lldb/Target/ThreadSpec.h index 204f1f9fbd70f..d00172d1763bd 100644 --- a/include/lldb/Target/ThreadSpec.h +++ b/include/lldb/Target/ThreadSpec.h @@ -45,7 +45,7 @@ public: static std::unique_ptr<ThreadSpec> CreateFromStructuredData(const StructuredData::Dictionary &data_dict, - Error &error); + Status &error); StructuredData::ObjectSP SerializeToStructuredData(); @@ -55,9 +55,9 @@ public: void SetTID(lldb::tid_t tid) { m_tid = tid; } - void SetName(const char *name) { m_name = name; } + void SetName(llvm::StringRef name) { m_name = name; } - void SetQueueName(const char *queue_name) { m_queue_name = queue_name; } + void SetQueueName(llvm::StringRef queue_name) { m_queue_name = queue_name; } uint32_t GetIndex() const { return m_index; } |