Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:54

0001 //===-- ProcessTrace.h ------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_TARGET_PROCESSTRACE_H
0010 #define LLDB_TARGET_PROCESSTRACE_H
0011 
0012 #include "lldb/Target/PostMortemProcess.h"
0013 #include "lldb/Utility/ConstString.h"
0014 #include "lldb/Utility/Status.h"
0015 
0016 namespace lldb_private {
0017 
0018 /// Class that represents a defunct process loaded on memory via the "trace
0019 /// load" command.
0020 class ProcessTrace : public PostMortemProcess {
0021 public:
0022   static void Initialize();
0023 
0024   static void Terminate();
0025 
0026   static llvm::StringRef GetPluginNameStatic() { return "trace"; }
0027 
0028   static llvm::StringRef GetPluginDescriptionStatic();
0029 
0030   ProcessTrace(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
0031                const FileSpec &core_file);
0032 
0033   ~ProcessTrace() override;
0034 
0035   bool CanDebug(lldb::TargetSP target_sp,
0036                 bool plugin_specified_by_name) override;
0037 
0038   void DidAttach(ArchSpec &process_arch) override;
0039 
0040   DynamicLoader *GetDynamicLoader() override { return nullptr; }
0041 
0042   SystemRuntime *GetSystemRuntime() override { return nullptr; }
0043 
0044   llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
0045 
0046   Status DoDestroy() override;
0047 
0048   void RefreshStateAfterStop() override;
0049 
0050   Status WillResume() override {
0051     return Status::FromErrorStringWithFormatv(
0052         "error: {0} does not support resuming processes", GetPluginName());
0053   }
0054 
0055   bool WarnBeforeDetach() const override { return false; }
0056 
0057   size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size,
0058                     Status &error) override;
0059 
0060   size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
0061                       Status &error) override;
0062 
0063   ArchSpec GetArchitecture();
0064 
0065   bool GetProcessInfo(ProcessInstanceInfo &info) override;
0066 
0067 protected:
0068   void Clear();
0069 
0070   bool DoUpdateThreadList(ThreadList &old_thread_list,
0071                           ThreadList &new_thread_list) override;
0072 
0073 private:
0074   static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp,
0075                                         lldb::ListenerSP listener_sp,
0076                                         const FileSpec *crash_file_path,
0077                                         bool can_connect);
0078 };
0079 
0080 } // namespace lldb_private
0081 
0082 #endif // LLDB_TARGET_PROCESSTRACE_H