28 virtual size_t getGPRSize()
const = 0;
31 virtual ErrorCode onEnableExtendedMode(
Session &session) = 0;
32 virtual ErrorCode onSetBaudRate(
Session &session, uint32_t speed) = 0;
33 virtual ErrorCode onToggleDebugFlag(
Session &session) = 0;
35 virtual ErrorCode onSetMaxPacketSize(
Session &session,
size_t size) = 0;
36 virtual ErrorCode onSetMaxPayloadSize(
Session &session,
size_t size) = 0;
38 virtual ErrorCode onSetLogging(
Session &session, std::string
const &mode,
39 std::string
const &filename,
40 StringCollection
const &flags) = 0;
41 virtual ErrorCode onSendInput(
Session &session, ByteVector
const &buf) = 0;
43 onAllowOperations(
Session &session,
44 std::map<std::string, bool>
const &operations) = 0;
46 onQuerySupported(
Session &session, Feature::Collection
const &remoteFeatures,
47 Feature::Collection &localFeatures)
const = 0;
49 virtual ErrorCode onExecuteCommand(
Session &session,
50 std::string
const &command) = 0;
52 virtual ErrorCode onQueryServerVersion(
Session &session,
54 virtual ErrorCode onQueryHostInfo(
Session &session,
HostInfo &info)
const = 0;
56 virtual ErrorCode onQueryFileLoadAddress(
Session &session,
57 std::string
const &file_path,
61 virtual ErrorCode onEnableControlAgent(
Session &session,
bool enable) = 0;
62 virtual ErrorCode onNonStopMode(
Session &session,
bool enable) = 0;
63 virtual ErrorCode onEnableBTSTracing(
Session &session,
bool enable) = 0;
65 virtual ErrorCode onPassSignals(
Session &session,
66 std::vector<int>
const &signals) = 0;
67 virtual ErrorCode onProgramSignals(
Session &session,
68 std::vector<int>
const &signals) = 0;
70 virtual ErrorCode onQuerySymbol(
Session &session, std::string
const &name,
71 std::string
const &value,
72 std::string &next)
const = 0;
74 virtual ErrorCode onQueryRegisterInfo(
Session &session, uint32_t regno,
77 virtual ErrorCode onAttach(
Session &session, ProcessId pid, AttachMode mode,
79 virtual ErrorCode onAttach(
Session &session, std::string
const &name,
80 AttachMode mode,
StopInfo &stop) = 0;
81 virtual ErrorCode onRunAttach(
Session &session, std::string
const &filename,
82 StringCollection
const &arguments,
84 virtual ErrorCode onDetach(
Session &session, ProcessId pid,
bool stopped) = 0;
85 virtual ErrorCode onQueryAttached(
Session &session, ProcessId pid,
86 bool &attachedProcess)
const = 0;
87 virtual ErrorCode onQueryProcessInfo(
Session &session,
89 virtual ErrorCode onQueryThreadStopInfo(
Session &session,
93 virtual ErrorCode onQueryHardwareWatchpointCount(
Session &session,
94 size_t &count)
const = 0;
96 virtual ErrorCode onQuerySectionOffsets(
Session &session,
Address &text,
98 bool &isSegment)
const = 0;
100 onQuerySharedLibrariesInfoAddress(
Session &session,
102 virtual ErrorCode onQuerySharedLibraryInfo(
Session &session,
103 std::string
const &path,
104 std::string
const &triple,
106 virtual ErrorCode onQueryModuleInfo(
Session &session, std::string &path,
110 virtual ErrorCode onRestart(
Session &session, ProcessId pid) = 0;
111 virtual ErrorCode onInterrupt(
Session &session) = 0;
114 virtual ErrorCode onExitServer(
Session &session) = 0;
116 virtual ErrorCode onSynchronizeThreadState(
Session &session,
124 virtual ErrorCode onQueryThreadList(
Session &session, ProcessId pid,
126 ThreadId &tid)
const = 0;
128 virtual ErrorCode onQueryCurrentThread(
Session &session,
130 virtual ErrorCode onThreadIsAlive(
Session &session,
132 virtual ErrorCode onQueryThreadInfo(
Session &session,
134 uint32_t mode,
void *info)
const = 0;
136 virtual ErrorCode onQueryTLSAddress(
Session &session,
141 virtual ErrorCode onQueryTIBAddress(
Session &session,
145 virtual ErrorCode onEnableAsynchronousProfiling(
Session &session,
149 uint32_t scanType) = 0;
150 virtual ErrorCode onQueryProfileData(
Session &session,
152 uint32_t scanType,
void *data)
const = 0;
154 virtual ErrorCode onResume(
Session &session,
155 ThreadResumeAction::Collection
const &actions,
160 Architecture::GPRegisterValueVector ®s) = 0;
163 std::vector<uint64_t>
const ®s) = 0;
165 virtual ErrorCode onSaveRegisters(
Session &session,
168 virtual ErrorCode onRestoreRegisters(
Session &session,
172 virtual ErrorCode onReadRegisterValue(
Session &session,
174 uint32_t regno, std::string &value) = 0;
175 virtual ErrorCode onWriteRegisterValue(
Session &session,
178 std::string
const &value) = 0;
180 virtual ErrorCode onReadMemory(
Session &session,
Address const &address,
181 size_t length, ByteVector &data) = 0;
182 virtual ErrorCode onWriteMemory(
Session &session,
Address const &address,
183 ByteVector
const &data,
size_t &nwritten) = 0;
185 virtual ErrorCode onAllocateMemory(
Session &session,
size_t size,
186 uint32_t permissions,
188 virtual ErrorCode onDeallocateMemory(
Session &session,
190 virtual ErrorCode onQueryMemoryRegionInfo(
Session &session,
194 virtual ErrorCode onComputeCRC(
Session &session,
Address const &address,
195 size_t length, uint32_t &crc) = 0;
197 virtual ErrorCode onSearch(
Session &session,
Address const &address,
198 std::string
const &pattern,
Address &location) = 0;
199 virtual ErrorCode onSearchBackward(
Session &session,
Address const &address,
200 uint32_t pattern, uint32_t mask,
203 virtual ErrorCode onInsertBreakpoint(
Session &session, BreakpointType type,
204 Address const &address, uint32_t kind,
205 StringCollection
const &conditions,
206 StringCollection
const &commands,
207 bool persistentCommands) = 0;
208 virtual ErrorCode onRemoveBreakpoint(
Session &session, BreakpointType type,
212 virtual ErrorCode onXferRead(
Session &session, std::string
const &
object,
213 std::string
const &annex, uint64_t offset,
214 uint64_t length, std::string &buffer,
216 virtual ErrorCode onXferWrite(
Session &session, std::string
const &
object,
217 std::string
const &annex, uint64_t offset,
218 std::string
const &buffer,
219 size_t &nwritten) = 0;
222 virtual ErrorCode fetchStopInfoForAllThreads(
Session &session,
223 std::vector<StopInfo> &stops,
225 virtual ErrorCode createThreadsStopInfo(
Session &session,
226 JSArray &threadsStopInfo) = 0;
229 virtual ErrorCode onDisableASLR(
Session &session,
bool disable) = 0;
231 virtual ErrorCode onSetEnvironmentVariable(
Session &session,
232 std::string
const &name,
233 std::string
const &value) = 0;
234 virtual ErrorCode onSetWorkingDirectory(
Session &session,
235 std::string
const &path) = 0;
236 virtual ErrorCode onSetStdFile(
Session &session,
int fileno,
237 std::string
const &path) = 0;
239 virtual ErrorCode onSetArchitecture(
Session &session,
240 std::string
const &architecture) = 0;
242 virtual ErrorCode onSetProgramArguments(
Session &session,
243 StringCollection
const &args) = 0;
245 virtual ErrorCode onExecuteProgram(
Session &session,
246 std::string
const &command,
248 std::string
const &workingDirectory,
251 virtual ErrorCode onFileCreateDirectory(
Session &session,
252 std::string
const &path,
255 virtual ErrorCode onFileOpen(
Session &session, std::string
const &path,
256 OpenFlags flags, uint32_t mode,
int &fd) = 0;
257 virtual ErrorCode onFileClose(
Session &session,
int fd) = 0;
258 virtual ErrorCode onFileRead(
Session &session,
int fd, uint64_t &count,
259 uint64_t offset, ByteVector &buffer) = 0;
260 virtual ErrorCode onFileWrite(
Session &session,
int fd, uint64_t offset,
261 ByteVector
const &buffer,
262 uint64_t &nwritten) = 0;
264 virtual ErrorCode onFileRemove(
Session &session, std::string
const &path) = 0;
265 virtual ErrorCode onFileReadLink(
Session &session, std::string
const &path,
266 std::string &resolved) = 0;
267 virtual ErrorCode onFileSetPermissions(
Session &session,
268 std::string
const &path,
270 virtual ErrorCode onFileExists(
Session &session, std::string
const &path) = 0;
271 virtual ErrorCode onFileComputeMD5(
Session &session, std::string
const &path,
272 uint8_t digest[16]) = 0;
273 virtual ErrorCode onFileGetSize(
Session &session, std::string
const &path,
275 virtual ErrorCode onFileGetMode(
Session &session, std::string
const &path,
276 uint32_t &mode)
const = 0;
277 virtual ErrorCode onFileFstat(
Session &session,
int fd,
278 ByteVector &buffer)
const = 0;
280 virtual ErrorCode onQueryProcessList(
Session &session,
283 virtual ErrorCode onQueryProcessInfoPID(
Session &session, ProcessId pid,
286 virtual ErrorCode onLaunchDebugServer(
Session &session,
287 std::string
const &host, uint16_t &port,
290 virtual ErrorCode onQueryLaunchSuccess(
Session &session,
291 ProcessId pid)
const = 0;
293 virtual ErrorCode onQueryUserName(
Session &session, UserId
const &uid,
294 std::string &name)
const = 0;
295 virtual ErrorCode onQueryGroupName(
Session &session, GroupId
const &gid,
296 std::string &name)
const = 0;
297 virtual ErrorCode onQueryWorkingDirectory(
Session &session,
298 std::string &workingDir)
const = 0;
301 virtual ErrorCode onReset(
Session &session) = 0;
302 virtual ErrorCode onFlashErase(
Session &session,
Address const &address,
304 virtual ErrorCode onFlashWrite(
Session &session,
Address const &address,
305 ByteVector
const &data) = 0;
306 virtual ErrorCode onFlashDone(
Session &session) = 0;