Debugger: Add dedicated functions for global {un}init.
[haiku.git] / src / apps / debugger / debugger_interface / interfaces / CoreFileDebuggerInterface.h
blob26263ceb17a954ebfdd8e41860174ed95044e011
1 /*
2 * Copyright 2016, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef CORE_FILE_DEBUGGER_INTERFACE_H
6 #define CORE_FILE_DEBUGGER_INTERFACE_H
9 #include "DebuggerInterface.h"
10 #include "TeamMemory.h"
13 class CoreFile;
14 struct CoreFileThreadInfo;
15 class ElfSection;
16 class ElfSymbolLookup;
19 class CoreFileDebuggerInterface : public DebuggerInterface {
20 public:
21 CoreFileDebuggerInterface(CoreFile* coreFile);
22 virtual ~CoreFileDebuggerInterface();
24 virtual status_t Init();
25 virtual void Close(bool killTeam);
27 virtual bool Connected() const;
29 virtual bool IsPostMortem() const;
31 virtual team_id TeamID() const;
33 virtual Architecture* GetArchitecture() const;
35 virtual status_t GetNextDebugEvent(DebugEvent*& _event);
37 virtual status_t SetTeamDebuggingFlags(uint32 flags);
39 virtual status_t ContinueThread(thread_id thread);
40 virtual status_t StopThread(thread_id thread);
41 virtual status_t SingleStepThread(thread_id thread);
43 virtual status_t InstallBreakpoint(target_addr_t address);
44 virtual status_t UninstallBreakpoint(target_addr_t address);
46 virtual status_t InstallWatchpoint(target_addr_t address,
47 uint32 type, int32 length);
48 virtual status_t UninstallWatchpoint(target_addr_t address);
50 virtual status_t GetSystemInfo(SystemInfo& info);
51 virtual status_t GetTeamInfo(TeamInfo& info);
52 virtual status_t GetThreadInfos(BObjectList<ThreadInfo>& infos);
53 virtual status_t GetImageInfos(BObjectList<ImageInfo>& infos);
54 virtual status_t GetAreaInfos(BObjectList<AreaInfo>& infos);
55 virtual status_t GetSemaphoreInfos(
56 BObjectList<SemaphoreInfo>& infos);
57 virtual status_t GetSymbolInfos(team_id team, image_id image,
58 BObjectList<SymbolInfo>& infos);
59 virtual status_t GetSymbolInfo(team_id team, image_id image,
60 const char* name, int32 symbolType,
61 SymbolInfo& info);
63 virtual status_t GetThreadInfo(thread_id thread,
64 ThreadInfo& info);
65 virtual status_t GetCpuState(thread_id thread,
66 CpuState*& _state);
67 // returns a reference to the caller
68 virtual status_t SetCpuState(thread_id thread,
69 const CpuState* state);
71 virtual status_t GetCpuFeatures(uint32& flags);
73 virtual status_t WriteCoreFile(const char* path);
75 // TeamMemory
76 virtual status_t GetMemoryProperties(target_addr_t address,
77 uint32& protection, uint32& locking);
79 virtual ssize_t ReadMemory(target_addr_t address, void* buffer,
80 size_t size);
81 virtual ssize_t WriteMemory(target_addr_t address,
82 void* buffer, size_t size);
84 private:
85 void _GetThreadInfo(
86 const CoreFileThreadInfo& coreInfo,
87 ThreadInfo& info);
88 status_t _CreateSharedObjectFileSymbolLookup(
89 const char* path,
90 ElfSymbolLookup*& _lookup);
92 private:
93 CoreFile* fCoreFile;
94 Architecture* fArchitecture;
98 #endif // CORE_FILE_DEBUGGER_INTERFACE_H