Debugger: Add dedicated functions for global {un}init.
[haiku.git] / src / apps / debugger / debugger_interface / DebuggerInterface.h
blob22cc0afd226762f9cdf66cb224e66a955a50e166
1 /*
2 * Copyright 2009-2016, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2010-2015, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
5 */
6 #ifndef DEBUGGER_INTERFACE_H
7 #define DEBUGGER_INTERFACE_H
9 #include <debugger.h>
11 #include <debug_support.h>
12 #include <ObjectList.h>
14 #include "TeamMemory.h"
17 class Architecture;
18 class AreaInfo;
19 class CpuState;
20 class DebugEvent;
21 class ElfSymbolLookup;
22 class ImageInfo;
23 class SemaphoreInfo;
24 class SymbolInfo;
25 class SystemInfo;
26 class TeamInfo;
27 class ThreadInfo;
29 namespace BPrivate {
30 class KMessage;
34 class DebuggerInterface : public TeamMemory {
35 public:
36 virtual ~DebuggerInterface();
38 virtual status_t Init()
39 = 0;
40 virtual void Close(bool killTeam) = 0;
42 virtual bool Connected() const = 0;
44 virtual bool IsPostMortem() const;
46 virtual team_id TeamID() const = 0;
48 virtual Architecture* GetArchitecture() const = 0;
50 virtual status_t GetNextDebugEvent(DebugEvent*& _event) = 0;
52 virtual status_t SetTeamDebuggingFlags(uint32 flags) = 0;
54 virtual status_t ContinueThread(thread_id thread) = 0;
55 virtual status_t StopThread(thread_id thread) = 0;
56 virtual status_t SingleStepThread(thread_id thread) = 0;
58 virtual status_t InstallBreakpoint(target_addr_t address) = 0;
59 virtual status_t UninstallBreakpoint(target_addr_t address) = 0;
61 virtual status_t InstallWatchpoint(target_addr_t address,
62 uint32 type, int32 length) = 0;
63 virtual status_t UninstallWatchpoint(target_addr_t address) = 0;
65 virtual status_t GetSystemInfo(SystemInfo& info) = 0;
66 virtual status_t GetTeamInfo(TeamInfo& info) = 0;
67 virtual status_t GetThreadInfos(BObjectList<ThreadInfo>& infos)
68 = 0;
69 virtual status_t GetImageInfos(BObjectList<ImageInfo>& infos)
70 = 0;
71 virtual status_t GetAreaInfos(BObjectList<AreaInfo>& infos)
72 = 0;
73 virtual status_t GetSemaphoreInfos(
74 BObjectList<SemaphoreInfo>& infos)
75 = 0;
77 virtual status_t GetSymbolInfos(team_id team, image_id image,
78 BObjectList<SymbolInfo>& infos) = 0;
79 virtual status_t GetSymbolInfo(team_id team, image_id image,
80 const char* name, int32 symbolType,
81 SymbolInfo& info) = 0;
83 virtual status_t GetThreadInfo(thread_id thread,
84 ThreadInfo& info) = 0;
85 virtual status_t GetCpuState(thread_id thread,
86 CpuState*& _state) = 0;
87 // returns a reference to the caller
88 virtual status_t SetCpuState(thread_id thread,
89 const CpuState* state) = 0;
91 virtual status_t GetCpuFeatures(uint32& flags) = 0;
93 virtual status_t WriteCoreFile(const char* path) = 0;
95 // TeamMemory
96 virtual status_t GetMemoryProperties(target_addr_t address,
97 uint32& protection, uint32& locking) = 0;
99 virtual ssize_t ReadMemory(target_addr_t address, void* buffer,
100 size_t size) = 0;
101 virtual ssize_t WriteMemory(target_addr_t address,
102 void* buffer, size_t size) = 0;
104 protected:
105 status_t GetElfSymbols(const char* filePath,
106 int64 textDelta,
107 BObjectList<SymbolInfo>& infos);
108 status_t GetElfSymbols(const void* symbolTable,
109 uint32 symbolCount,
110 uint32 symbolTableEntrySize,
111 const char* stringTable,
112 uint32 stringTableSize, bool is64Bit,
113 bool swappedByteOrder, int64 textDelta,
114 BObjectList<SymbolInfo>& infos);
115 status_t GetElfSymbols(ElfSymbolLookup* symbolLookup,
116 BObjectList<SymbolInfo>& infos);
118 private:
119 struct SymbolTableLookupSource;
123 #endif // DEBUGGER_INTERFACE_H