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.
6 #ifndef DEBUGGER_INTERFACE_H
7 #define DEBUGGER_INTERFACE_H
11 #include <debug_support.h>
12 #include <ObjectList.h>
14 #include "TeamMemory.h"
21 class ElfSymbolLookup
;
34 class DebuggerInterface
: public TeamMemory
{
36 virtual ~DebuggerInterface();
38 virtual status_t
Init()
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
)
69 virtual status_t
GetImageInfos(BObjectList
<ImageInfo
>& infos
)
71 virtual status_t
GetAreaInfos(BObjectList
<AreaInfo
>& infos
)
73 virtual status_t
GetSemaphoreInfos(
74 BObjectList
<SemaphoreInfo
>& infos
)
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;
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
,
101 virtual ssize_t
WriteMemory(target_addr_t address
,
102 void* buffer
, size_t size
) = 0;
105 status_t
GetElfSymbols(const char* filePath
,
107 BObjectList
<SymbolInfo
>& infos
);
108 status_t
GetElfSymbols(const void* symbolTable
,
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
);
119 struct SymbolTableLookupSource
;
123 #endif // DEBUGGER_INTERFACE_H