Commit | Line | Data |
---|---|---|
ce3a066d | 1 | /* Target operations for the remote server for GDB. |
0b302171 | 2 | Copyright (C) 2002-2005, 2007-2012 Free Software Foundation, Inc. |
ce3a066d DJ |
3 | |
4 | Contributed by MontaVista Software. | |
5 | ||
6 | This file is part of GDB. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 10 | the Free Software Foundation; either version 3 of the License, or |
ce3a066d DJ |
11 | (at your option) any later version. |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
ce3a066d DJ |
20 | |
21 | #ifndef TARGET_H | |
22 | #define TARGET_H | |
23 | ||
6a271cae PA |
24 | struct emit_ops; |
25 | ||
bd99dc85 PA |
26 | /* Ways to "resume" a thread. */ |
27 | ||
28 | enum resume_kind | |
29 | { | |
30 | /* Thread should continue. */ | |
31 | resume_continue, | |
32 | ||
33 | /* Thread should single-step. */ | |
34 | resume_step, | |
35 | ||
36 | /* Thread should be stopped. */ | |
37 | resume_stop | |
38 | }; | |
39 | ||
2bd7c093 PA |
40 | /* This structure describes how to resume a particular thread (or all |
41 | threads) based on the client's request. If thread is -1, then this | |
42 | entry applies to all threads. These are passed around as an | |
43 | array. */ | |
64386c31 DJ |
44 | |
45 | struct thread_resume | |
46 | { | |
95954743 | 47 | ptid_t thread; |
64386c31 | 48 | |
bd99dc85 PA |
49 | /* How to "resume". */ |
50 | enum resume_kind kind; | |
64386c31 | 51 | |
bd99dc85 PA |
52 | /* If non-zero, send this signal when we resume, or to stop the |
53 | thread. If stopping a thread, and this is 0, the target should | |
54 | stop the thread however it best decides to (e.g., SIGSTOP on | |
30d50328 JK |
55 | linux; SuspendThread on win32). This is a host signal value (not |
56 | enum target_signal). */ | |
64386c31 DJ |
57 | int sig; |
58 | }; | |
59 | ||
5b1c542e PA |
60 | /* Generally, what has the program done? */ |
61 | enum target_waitkind | |
62 | { | |
63 | /* The program has exited. The exit status is in | |
64 | value.integer. */ | |
65 | TARGET_WAITKIND_EXITED, | |
66 | ||
67 | /* The program has stopped with a signal. Which signal is in | |
68 | value.sig. */ | |
69 | TARGET_WAITKIND_STOPPED, | |
70 | ||
71 | /* The program has terminated with a signal. Which signal is in | |
72 | value.sig. */ | |
73 | TARGET_WAITKIND_SIGNALLED, | |
74 | ||
75 | /* The program is letting us know that it dynamically loaded | |
76 | something. */ | |
77 | TARGET_WAITKIND_LOADED, | |
78 | ||
79 | /* The program has exec'ed a new executable file. The new file's | |
80 | pathname is pointed to by value.execd_pathname. */ | |
81 | TARGET_WAITKIND_EXECD, | |
82 | ||
83 | /* Nothing of interest to GDB happened, but we stopped anyway. */ | |
84 | TARGET_WAITKIND_SPURIOUS, | |
85 | ||
86 | /* An event has occurred, but we should wait again. In this case, | |
87 | we want to go back to the event loop and wait there for another | |
88 | event from the inferior. */ | |
89 | TARGET_WAITKIND_IGNORE | |
90 | }; | |
91 | ||
92 | struct target_waitstatus | |
93 | { | |
94 | enum target_waitkind kind; | |
95 | ||
96 | /* Forked child pid, execd pathname, exit status or signal number. */ | |
97 | union | |
98 | { | |
99 | int integer; | |
100 | enum target_signal sig; | |
95954743 | 101 | ptid_t related_pid; |
5b1c542e PA |
102 | char *execd_pathname; |
103 | } | |
104 | value; | |
105 | }; | |
106 | ||
bd99dc85 PA |
107 | /* Options that can be passed to target_ops->wait. */ |
108 | ||
109 | #define TARGET_WNOHANG 1 | |
110 | ||
ce3a066d DJ |
111 | struct target_ops |
112 | { | |
113 | /* Start a new process. | |
114 | ||
115 | PROGRAM is a path to the program to execute. | |
116 | ARGS is a standard NULL-terminated array of arguments, | |
117 | to be passed to the inferior as ``argv''. | |
118 | ||
a9fa9f7d | 119 | Returns the new PID on success, -1 on failure. Registers the new |
ce3a066d DJ |
120 | process with the process list. */ |
121 | ||
122 | int (*create_inferior) (char *program, char **args); | |
123 | ||
124 | /* Attach to a running process. | |
125 | ||
126 | PID is the process ID to attach to, specified by the user | |
1d5315fe PA |
127 | or a higher layer. |
128 | ||
129 | Returns -1 if attaching is unsupported, 0 on success, and calls | |
130 | error() otherwise. */ | |
ce3a066d | 131 | |
a1928bad | 132 | int (*attach) (unsigned long pid); |
ce3a066d | 133 | |
95954743 | 134 | /* Kill inferior PID. Return -1 on failure, and 0 on success. */ |
ce3a066d | 135 | |
95954743 | 136 | int (*kill) (int pid); |
ce3a066d | 137 | |
95954743 PA |
138 | /* Detach from inferior PID. Return -1 on failure, and 0 on |
139 | success. */ | |
6ad8ae5c | 140 | |
95954743 | 141 | int (*detach) (int pid); |
444d6139 | 142 | |
8336d594 PA |
143 | /* The inferior process has died. Do what is right. */ |
144 | ||
145 | void (*mourn) (struct process_info *proc); | |
146 | ||
95954743 PA |
147 | /* Wait for inferior PID to exit. */ |
148 | void (*join) (int pid); | |
6ad8ae5c | 149 | |
ce3a066d DJ |
150 | /* Return 1 iff the thread with process ID PID is alive. */ |
151 | ||
95954743 | 152 | int (*thread_alive) (ptid_t pid); |
ce3a066d | 153 | |
64386c31 | 154 | /* Resume the inferior process. */ |
ce3a066d | 155 | |
2bd7c093 | 156 | void (*resume) (struct thread_resume *resume_info, size_t n); |
ce3a066d | 157 | |
5b1c542e | 158 | /* Wait for the inferior process or thread to change state. Store |
95954743 PA |
159 | status through argument pointer STATUS. |
160 | ||
161 | PTID = -1 to wait for any pid to do something, PTID(pid,0,0) to | |
162 | wait for any thread of process pid to do something. Return ptid | |
163 | of child, or -1 in case of error; store status through argument | |
164 | pointer STATUS. OPTIONS is a bit set of options defined as | |
165 | TARGET_W* above. If options contains TARGET_WNOHANG and there's | |
166 | no child stop to report, return is | |
167 | null_ptid/TARGET_WAITKIND_IGNORE. */ | |
ce3a066d | 168 | |
95954743 | 169 | ptid_t (*wait) (ptid_t ptid, struct target_waitstatus *status, int options); |
ce3a066d DJ |
170 | |
171 | /* Fetch registers from the inferior process. | |
172 | ||
173 | If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */ | |
174 | ||
442ea881 | 175 | void (*fetch_registers) (struct regcache *regcache, int regno); |
aa691b87 | 176 | |
ce3a066d DJ |
177 | /* Store registers to the inferior process. |
178 | ||
179 | If REGNO is -1, store all registers; otherwise, store at least REGNO. */ | |
180 | ||
442ea881 | 181 | void (*store_registers) (struct regcache *regcache, int regno); |
ce3a066d | 182 | |
90d74c30 PA |
183 | /* Prepare to read or write memory from the inferior process. |
184 | Targets use this to do what is necessary to get the state of the | |
185 | inferior such that it is possible to access memory. | |
186 | ||
187 | This should generally only be called from client facing routines, | |
188 | such as gdb_read_memory/gdb_write_memory, or the insert_point | |
189 | callbacks. | |
190 | ||
191 | Like `read_memory' and `write_memory' below, returns 0 on success | |
192 | and errno on failure. */ | |
193 | ||
194 | int (*prepare_to_access_memory) (void); | |
195 | ||
196 | /* Undo the effects of prepare_to_access_memory. */ | |
197 | ||
0146f85b | 198 | void (*done_accessing_memory) (void); |
90d74c30 | 199 | |
611cb4a5 DJ |
200 | /* Read memory from the inferior process. This should generally be |
201 | called through read_inferior_memory, which handles breakpoint shadowing. | |
ce3a066d | 202 | |
c3e735a6 DJ |
203 | Read LEN bytes at MEMADDR into a buffer at MYADDR. |
204 | ||
205 | Returns 0 on success and errno on failure. */ | |
ce3a066d | 206 | |
f450004a | 207 | int (*read_memory) (CORE_ADDR memaddr, unsigned char *myaddr, int len); |
ce3a066d | 208 | |
611cb4a5 DJ |
209 | /* Write memory to the inferior process. This should generally be |
210 | called through write_inferior_memory, which handles breakpoint shadowing. | |
ce3a066d DJ |
211 | |
212 | Write LEN bytes from the buffer at MYADDR to MEMADDR. | |
213 | ||
214 | Returns 0 on success and errno on failure. */ | |
215 | ||
f450004a DJ |
216 | int (*write_memory) (CORE_ADDR memaddr, const unsigned char *myaddr, |
217 | int len); | |
2f2893d9 DJ |
218 | |
219 | /* Query GDB for the values of any symbols we're interested in. | |
220 | This function is called whenever we receive a "qSymbols::" | |
221 | query, which corresponds to every time more symbols (might) | |
611cb4a5 DJ |
222 | become available. NULL if we aren't interested in any |
223 | symbols. */ | |
2f2893d9 DJ |
224 | |
225 | void (*look_up_symbols) (void); | |
e5379b03 | 226 | |
ef57601b PA |
227 | /* Send an interrupt request to the inferior process, |
228 | however is appropriate. */ | |
229 | ||
230 | void (*request_interrupt) (void); | |
aa691b87 RM |
231 | |
232 | /* Read auxiliary vector data from the inferior process. | |
233 | ||
234 | Read LEN bytes at OFFSET into a buffer at MYADDR. */ | |
235 | ||
f450004a DJ |
236 | int (*read_auxv) (CORE_ADDR offset, unsigned char *myaddr, |
237 | unsigned int len); | |
e013ee27 | 238 | |
d993e290 | 239 | /* Insert and remove a break or watchpoint. |
1b3f6016 | 240 | Returns 0 on success, -1 on failure and 1 on unsupported. |
e013ee27 | 241 | The type is coded as follows: |
c6314022 AR |
242 | '0' - software-breakpoint |
243 | '1' - hardware-breakpoint | |
244 | '2' - write watchpoint | |
245 | '3' - read watchpoint | |
246 | '4' - access watchpoint */ | |
e013ee27 | 247 | |
d993e290 PA |
248 | int (*insert_point) (char type, CORE_ADDR addr, int len); |
249 | int (*remove_point) (char type, CORE_ADDR addr, int len); | |
e013ee27 OF |
250 | |
251 | /* Returns 1 if target was stopped due to a watchpoint hit, 0 otherwise. */ | |
252 | ||
253 | int (*stopped_by_watchpoint) (void); | |
254 | ||
1b3f6016 | 255 | /* Returns the address associated with the watchpoint that hit, if any; |
e013ee27 OF |
256 | returns 0 otherwise. */ |
257 | ||
258 | CORE_ADDR (*stopped_data_address) (void); | |
259 | ||
52fb6437 NS |
260 | /* Reports the text, data offsets of the executable. This is |
261 | needed for uclinux where the executable is relocated during load | |
262 | time. */ | |
1b3f6016 | 263 | |
52fb6437 | 264 | int (*read_offsets) (CORE_ADDR *text, CORE_ADDR *data); |
dae5f5cf DJ |
265 | |
266 | /* Fetch the address associated with a specific thread local storage | |
267 | area, determined by the specified THREAD, OFFSET, and LOAD_MODULE. | |
268 | Stores it in *ADDRESS and returns zero on success; otherwise returns | |
269 | an error code. A return value of -1 means this system does not | |
270 | support the operation. */ | |
271 | ||
272 | int (*get_tls_address) (struct thread_info *thread, CORE_ADDR offset, | |
273 | CORE_ADDR load_module, CORE_ADDR *address); | |
23181151 | 274 | |
0e7f50da UW |
275 | /* Read/Write from/to spufs using qXfer packets. */ |
276 | int (*qxfer_spu) (const char *annex, unsigned char *readbuf, | |
277 | unsigned const char *writebuf, CORE_ADDR offset, int len); | |
59a016f0 PA |
278 | |
279 | /* Fill BUF with an hostio error packet representing the last hostio | |
280 | error. */ | |
281 | void (*hostio_last_error) (char *buf); | |
07e059b5 VP |
282 | |
283 | /* Read/Write OS data using qXfer packets. */ | |
284 | int (*qxfer_osdata) (const char *annex, unsigned char *readbuf, | |
1b3f6016 | 285 | unsigned const char *writebuf, CORE_ADDR offset, |
07e059b5 | 286 | int len); |
4aa995e1 PA |
287 | |
288 | /* Read/Write extra signal info. */ | |
289 | int (*qxfer_siginfo) (const char *annex, unsigned char *readbuf, | |
290 | unsigned const char *writebuf, | |
291 | CORE_ADDR offset, int len); | |
bd99dc85 PA |
292 | |
293 | int (*supports_non_stop) (void); | |
294 | ||
295 | /* Enables async target events. Returns the previous enable | |
296 | state. */ | |
297 | int (*async) (int enable); | |
298 | ||
299 | /* Switch to non-stop (1) or all-stop (0) mode. Return 0 on | |
300 | success, -1 otherwise. */ | |
301 | int (*start_non_stop) (int); | |
cf8fd78b PA |
302 | |
303 | /* Returns true if the target supports multi-process debugging. */ | |
304 | int (*supports_multi_process) (void); | |
cdbfd419 PP |
305 | |
306 | /* If not NULL, target-specific routine to process monitor command. | |
307 | Returns 1 if handled, or 0 to perform default processing. */ | |
308 | int (*handle_monitor_command) (char *); | |
dc146f7c VP |
309 | |
310 | /* Returns the core given a thread, or -1 if not known. */ | |
311 | int (*core_of_thread) (ptid_t); | |
1570b33e | 312 | |
78d85199 YQ |
313 | /* Read loadmaps. Read LEN bytes at OFFSET into a buffer at MYADDR. */ |
314 | int (*read_loadmap) (const char *annex, CORE_ADDR offset, | |
881127c9 | 315 | unsigned char *myaddr, unsigned int len); |
78d85199 | 316 | |
1570b33e L |
317 | /* Target specific qSupported support. */ |
318 | void (*process_qsupported) (const char *); | |
219f2f23 PA |
319 | |
320 | /* Return 1 if the target supports tracepoints, 0 (or leave the | |
321 | callback NULL) otherwise. */ | |
322 | int (*supports_tracepoints) (void); | |
323 | ||
324 | /* Read PC from REGCACHE. */ | |
325 | CORE_ADDR (*read_pc) (struct regcache *regcache); | |
326 | ||
327 | /* Write PC to REGCACHE. */ | |
328 | void (*write_pc) (struct regcache *regcache, CORE_ADDR pc); | |
8336d594 PA |
329 | |
330 | /* Return true if THREAD is known to be stopped now. */ | |
331 | int (*thread_stopped) (struct thread_info *thread); | |
332 | ||
711e434b PM |
333 | /* Read Thread Information Block address. */ |
334 | int (*get_tib_address) (ptid_t ptid, CORE_ADDR *address); | |
7984d532 | 335 | |
609086b1 | 336 | /* Pause all threads. If FREEZE, arrange for any resume attempt to |
7984d532 PA |
337 | be ignored until an unpause_all call unfreezes threads again. |
338 | There can be nested calls to pause_all, so a freeze counter | |
339 | should be maintained. */ | |
340 | void (*pause_all) (int freeze); | |
341 | ||
342 | /* Unpause all threads. Threads that hadn't been resumed by the | |
343 | client should be left stopped. Basically a pause/unpause call | |
344 | pair should not end up resuming threads that were stopped before | |
345 | the pause call. */ | |
346 | void (*unpause_all) (int unfreeze); | |
347 | ||
348 | /* Cancel all pending breakpoints hits in all threads. */ | |
349 | void (*cancel_breakpoints) (void); | |
fa593d66 PA |
350 | |
351 | /* Stabilize all threads. That is, force them out of jump pads. */ | |
352 | void (*stabilize_threads) (void); | |
353 | ||
354 | /* Install a fast tracepoint jump pad. TPOINT is the address of the | |
355 | tracepoint internal object as used by the IPA agent. TPADDR is | |
356 | the address of tracepoint. COLLECTOR is address of the function | |
357 | the jump pad redirects to. LOCKADDR is the address of the jump | |
358 | pad lock object. ORIG_SIZE is the size in bytes of the | |
359 | instruction at TPADDR. JUMP_ENTRY points to the address of the | |
360 | jump pad entry, and on return holds the address past the end of | |
405f8e94 SS |
361 | the created jump pad. If a trampoline is created by the function, |
362 | then TRAMPOLINE and TRAMPOLINE_SIZE return the address and size of | |
363 | the trampoline, else they remain unchanged. JJUMP_PAD_INSN is a | |
364 | buffer containing a copy of the instruction at TPADDR. | |
365 | ADJUST_INSN_ADDR and ADJUST_INSN_ADDR_END are output parameters that | |
366 | return the address range where the instruction at TPADDR was relocated | |
367 | to. If an error occurs, the ERR may be used to pass on an error | |
368 | message. */ | |
fa593d66 PA |
369 | int (*install_fast_tracepoint_jump_pad) (CORE_ADDR tpoint, CORE_ADDR tpaddr, |
370 | CORE_ADDR collector, | |
371 | CORE_ADDR lockaddr, | |
372 | ULONGEST orig_size, | |
373 | CORE_ADDR *jump_entry, | |
405f8e94 SS |
374 | CORE_ADDR *trampoline, |
375 | ULONGEST *trampoline_size, | |
fa593d66 PA |
376 | unsigned char *jjump_pad_insn, |
377 | ULONGEST *jjump_pad_insn_size, | |
378 | CORE_ADDR *adjusted_insn_addr, | |
405f8e94 SS |
379 | CORE_ADDR *adjusted_insn_addr_end, |
380 | char *err); | |
6a271cae PA |
381 | |
382 | /* Return the bytecode operations vector for the current inferior. | |
383 | Returns NULL if bytecode compilation is not supported. */ | |
384 | struct emit_ops *(*emit_ops) (void); | |
03583c20 UW |
385 | |
386 | /* Returns true if the target supports disabling randomization. */ | |
387 | int (*supports_disable_randomization) (void); | |
405f8e94 SS |
388 | |
389 | /* Return the minimum length of an instruction that can be safely overwritten | |
390 | for use as a fast tracepoint. */ | |
391 | int (*get_min_fast_tracepoint_insn_len) (void); | |
2268b414 JK |
392 | |
393 | /* Read solib info on SVR4 platforms. */ | |
394 | int (*qxfer_libraries_svr4) (const char *annex, unsigned char *readbuf, | |
395 | unsigned const char *writebuf, | |
396 | CORE_ADDR offset, int len); | |
ce3a066d DJ |
397 | }; |
398 | ||
399 | extern struct target_ops *the_target; | |
400 | ||
401 | void set_target_ops (struct target_ops *); | |
402 | ||
403 | #define create_inferior(program, args) \ | |
404 | (*the_target->create_inferior) (program, args) | |
405 | ||
406 | #define myattach(pid) \ | |
407 | (*the_target->attach) (pid) | |
408 | ||
95954743 PA |
409 | #define kill_inferior(pid) \ |
410 | (*the_target->kill) (pid) | |
ce3a066d | 411 | |
95954743 PA |
412 | #define detach_inferior(pid) \ |
413 | (*the_target->detach) (pid) | |
6ad8ae5c | 414 | |
8336d594 PA |
415 | #define mourn_inferior(PROC) \ |
416 | (*the_target->mourn) (PROC) | |
417 | ||
ce3a066d DJ |
418 | #define mythread_alive(pid) \ |
419 | (*the_target->thread_alive) (pid) | |
420 | ||
442ea881 PA |
421 | #define fetch_inferior_registers(regcache, regno) \ |
422 | (*the_target->fetch_registers) (regcache, regno) | |
ce3a066d | 423 | |
442ea881 PA |
424 | #define store_inferior_registers(regcache, regno) \ |
425 | (*the_target->store_registers) (regcache, regno) | |
ce3a066d | 426 | |
95954743 PA |
427 | #define join_inferior(pid) \ |
428 | (*the_target->join) (pid) | |
444d6139 | 429 | |
bd99dc85 PA |
430 | #define target_supports_non_stop() \ |
431 | (the_target->supports_non_stop ? (*the_target->supports_non_stop ) () : 0) | |
432 | ||
433 | #define target_async(enable) \ | |
434 | (the_target->async ? (*the_target->async) (enable) : 0) | |
435 | ||
cf8fd78b PA |
436 | #define target_supports_multi_process() \ |
437 | (the_target->supports_multi_process ? \ | |
438 | (*the_target->supports_multi_process) () : 0) | |
439 | ||
8336d594 PA |
440 | #define target_process_qsupported(query) \ |
441 | do \ | |
442 | { \ | |
443 | if (the_target->process_qsupported) \ | |
444 | the_target->process_qsupported (query); \ | |
445 | } while (0) | |
1570b33e | 446 | |
219f2f23 PA |
447 | #define target_supports_tracepoints() \ |
448 | (the_target->supports_tracepoints \ | |
449 | ? (*the_target->supports_tracepoints) () : 0) | |
450 | ||
fa593d66 PA |
451 | #define target_supports_fast_tracepoints() \ |
452 | (the_target->install_fast_tracepoint_jump_pad != NULL) | |
453 | ||
405f8e94 SS |
454 | #define target_get_min_fast_tracepoint_insn_len() \ |
455 | (the_target->get_min_fast_tracepoint_insn_len \ | |
456 | ? (*the_target->get_min_fast_tracepoint_insn_len) () : 0) | |
457 | ||
8336d594 PA |
458 | #define thread_stopped(thread) \ |
459 | (*the_target->thread_stopped) (thread) | |
460 | ||
7984d532 PA |
461 | #define pause_all(freeze) \ |
462 | do \ | |
463 | { \ | |
464 | if (the_target->pause_all) \ | |
465 | (*the_target->pause_all) (freeze); \ | |
466 | } while (0) | |
467 | ||
468 | #define unpause_all(unfreeze) \ | |
469 | do \ | |
470 | { \ | |
471 | if (the_target->unpause_all) \ | |
472 | (*the_target->unpause_all) (unfreeze); \ | |
473 | } while (0) | |
474 | ||
475 | #define cancel_breakpoints() \ | |
476 | do \ | |
477 | { \ | |
478 | if (the_target->cancel_breakpoints) \ | |
479 | (*the_target->cancel_breakpoints) (); \ | |
8336d594 PA |
480 | } while (0) |
481 | ||
fa593d66 PA |
482 | #define stabilize_threads() \ |
483 | do \ | |
484 | { \ | |
485 | if (the_target->stabilize_threads) \ | |
486 | (*the_target->stabilize_threads) (); \ | |
487 | } while (0) | |
488 | ||
489 | #define install_fast_tracepoint_jump_pad(tpoint, tpaddr, \ | |
490 | collector, lockaddr, \ | |
491 | orig_size, \ | |
405f8e94 SS |
492 | jump_entry, \ |
493 | trampoline, trampoline_size, \ | |
494 | jjump_pad_insn, \ | |
fa593d66 PA |
495 | jjump_pad_insn_size, \ |
496 | adjusted_insn_addr, \ | |
405f8e94 SS |
497 | adjusted_insn_addr_end, \ |
498 | err) \ | |
fa593d66 PA |
499 | (*the_target->install_fast_tracepoint_jump_pad) (tpoint, tpaddr, \ |
500 | collector,lockaddr, \ | |
501 | orig_size, jump_entry, \ | |
405f8e94 SS |
502 | trampoline, \ |
503 | trampoline_size, \ | |
fa593d66 PA |
504 | jjump_pad_insn, \ |
505 | jjump_pad_insn_size, \ | |
506 | adjusted_insn_addr, \ | |
405f8e94 SS |
507 | adjusted_insn_addr_end, \ |
508 | err) | |
fa593d66 | 509 | |
6a271cae PA |
510 | #define target_emit_ops() \ |
511 | (the_target->emit_ops ? (*the_target->emit_ops) () : NULL) | |
512 | ||
03583c20 UW |
513 | #define target_supports_disable_randomization() \ |
514 | (the_target->supports_disable_randomization ? \ | |
515 | (*the_target->supports_disable_randomization) () : 0) | |
516 | ||
bd99dc85 PA |
517 | /* Start non-stop mode, returns 0 on success, -1 on failure. */ |
518 | ||
519 | int start_non_stop (int nonstop); | |
520 | ||
95954743 PA |
521 | ptid_t mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options, |
522 | int connected_wait); | |
0d62e5e8 | 523 | |
90d74c30 PA |
524 | #define prepare_to_access_memory() \ |
525 | (the_target->prepare_to_access_memory \ | |
526 | ? (*the_target->prepare_to_access_memory) () \ | |
527 | : 0) | |
528 | ||
0146f85b | 529 | #define done_accessing_memory() \ |
90d74c30 PA |
530 | do \ |
531 | { \ | |
0146f85b PA |
532 | if (the_target->done_accessing_memory) \ |
533 | (*the_target->done_accessing_memory) (); \ | |
90d74c30 PA |
534 | } while (0) |
535 | ||
f450004a | 536 | int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len); |
ce3a066d | 537 | |
f450004a DJ |
538 | int write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, |
539 | int len); | |
0d62e5e8 DJ |
540 | |
541 | void set_desired_inferior (int id); | |
ce3a066d | 542 | |
95954743 PA |
543 | const char *target_pid_to_str (ptid_t); |
544 | ||
8336d594 PA |
545 | const char *target_waitstatus_to_string (const struct target_waitstatus *); |
546 | ||
ce3a066d | 547 | #endif /* TARGET_H */ |