Changeset View
Changeset View
Standalone View
Standalone View
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
Show All 25 Lines | |||||
/// @class NativeProcessNetBSD | /// @class NativeProcessNetBSD | ||||
/// @brief Manages communication with the inferior (debugee) process. | /// @brief Manages communication with the inferior (debugee) process. | ||||
/// | /// | ||||
/// Upon construction, this class prepares and launches an inferior process for | /// Upon construction, this class prepares and launches an inferior process for | ||||
/// debugging. | /// debugging. | ||||
/// | /// | ||||
/// Changes in the inferior process state are broadcasted. | /// Changes in the inferior process state are broadcasted. | ||||
class NativeProcessNetBSD : public NativeProcessProtocol { | class NativeProcessNetBSD : public NativeProcessProtocol { | ||||
friend Status NativeProcessProtocol::Launch( | |||||
ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, | |||||
MainLoop &mainloop, NativeProcessProtocolSP &process_sp); | |||||
friend Status NativeProcessProtocol::Attach( | |||||
lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate, | |||||
MainLoop &mainloop, NativeProcessProtocolSP &process_sp); | |||||
public: | public: | ||||
class Factory : public NativeProcessProtocol::Factory { | |||||
public: | |||||
llvm::Expected<NativeProcessProtocolSP> | |||||
Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, | |||||
MainLoop &mainloop) const override; | |||||
llvm::Expected<NativeProcessProtocolSP> | |||||
Attach(lldb::pid_t pid, NativeDelegate &native_delegate, | |||||
MainLoop &mainloop) const override; | |||||
}; | |||||
// --------------------------------------------------------------------- | // --------------------------------------------------------------------- | ||||
// NativeProcessProtocol Interface | // NativeProcessProtocol Interface | ||||
// --------------------------------------------------------------------- | // --------------------------------------------------------------------- | ||||
Status Resume(const ResumeActionList &resume_actions) override; | Status Resume(const ResumeActionList &resume_actions) override; | ||||
Status Halt() override; | Status Halt() override; | ||||
Status Detach() override; | Status Detach() override; | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | protected: | ||||
Status | Status | ||||
GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint, | GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint, | ||||
size_t &actual_opcode_size, | size_t &actual_opcode_size, | ||||
const uint8_t *&trap_opcode_bytes) override; | const uint8_t *&trap_opcode_bytes) override; | ||||
private: | private: | ||||
MainLoop::SignalHandleUP m_sigchld_handle; | MainLoop::SignalHandleUP m_sigchld_handle; | ||||
ArchSpec m_arch; | ArchSpec m_arch; | ||||
LazyBool m_supports_mem_region; | LazyBool m_supports_mem_region = eLazyBoolCalculate; | ||||
std::vector<std::pair<MemoryRegionInfo, FileSpec>> m_mem_region_cache; | std::vector<std::pair<MemoryRegionInfo, FileSpec>> m_mem_region_cache; | ||||
// --------------------------------------------------------------------- | // --------------------------------------------------------------------- | ||||
// Private Instance Methods | // Private Instance Methods | ||||
// --------------------------------------------------------------------- | // --------------------------------------------------------------------- | ||||
NativeProcessNetBSD(); | NativeProcessNetBSD(::pid_t pid, int terminal_fd, NativeDelegate &delegate, | ||||
const ArchSpec &arch, MainLoop &mainloop); | |||||
bool HasThreadNoLock(lldb::tid_t thread_id); | bool HasThreadNoLock(lldb::tid_t thread_id); | ||||
NativeThreadNetBSDSP AddThread(lldb::tid_t thread_id); | NativeThreadNetBSDSP AddThread(lldb::tid_t thread_id); | ||||
Status LaunchInferior(MainLoop &mainloop, ProcessLaunchInfo &launch_info); | |||||
void AttachToInferior(MainLoop &mainloop, lldb::pid_t pid, Status &error); | |||||
void MonitorCallback(lldb::pid_t pid, int signal); | void MonitorCallback(lldb::pid_t pid, int signal); | ||||
void MonitorExited(lldb::pid_t pid, WaitStatus status); | void MonitorExited(lldb::pid_t pid, WaitStatus status); | ||||
void MonitorSIGSTOP(lldb::pid_t pid); | void MonitorSIGSTOP(lldb::pid_t pid); | ||||
void MonitorSIGTRAP(lldb::pid_t pid); | void MonitorSIGTRAP(lldb::pid_t pid); | ||||
void MonitorSignal(lldb::pid_t pid, int signal); | void MonitorSignal(lldb::pid_t pid, int signal); | ||||
Status GetSoftwareBreakpointPCOffset(uint32_t &actual_opcode_size); | Status GetSoftwareBreakpointPCOffset(uint32_t &actual_opcode_size); | ||||
Status FixupBreakpointPCAsNeeded(NativeThreadNetBSD &thread); | Status FixupBreakpointPCAsNeeded(NativeThreadNetBSD &thread); | ||||
Status PopulateMemoryRegionCache(); | Status PopulateMemoryRegionCache(); | ||||
void SigchldHandler(); | void SigchldHandler(); | ||||
::pid_t Attach(lldb::pid_t pid, Status &error); | Status Attach(); | ||||
Status ReinitializeThreads(); | Status ReinitializeThreads(); | ||||
}; | }; | ||||
} // namespace process_netbsd | } // namespace process_netbsd | ||||
} // namespace lldb_private | } // namespace lldb_private | ||||
#endif // #ifndef liblldb_NativeProcessNetBSD_H_ | #endif // #ifndef liblldb_NativeProcessNetBSD_H_ |