Introduce target_{stop,continue}_ptid
[deliverable/binutils-gdb.git] / gdb / target / target.h
1 /* Declarations for common target functions.
2
3 Copyright (C) 1986-2014 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 #ifndef TARGET_COMMON_H
21 #define TARGET_COMMON_H
22
23 #include "target/waitstatus.h"
24 #include <stdint.h>
25
26 /* This header is a stopgap until more code is shared. */
27
28 /* Read LEN bytes of target memory at address MEMADDR, placing the
29 results in GDB's memory at MYADDR. Return zero for success,
30 nonzero if any error occurs. This function must be provided by
31 the client. Implementations of this function may define and use
32 their own error codes, but functions in the common, nat and target
33 directories must treat the return code as opaque. No guarantee is
34 made about the contents of the data at MYADDR if any error
35 occurs. */
36
37 extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
38 ssize_t len);
39
40 /* Read an unsigned 32-bit integer in the target's format from target
41 memory at address MEMADDR, storing the result in GDB's format in
42 GDB's memory at RESULT. Return zero for success, nonzero if any
43 error occurs. This function must be provided by the client.
44 Implementations of this function may define and use their own error
45 codes, but functions in the common, nat and target directories must
46 treat the return code as opaque. No guarantee is made about the
47 contents of the data at RESULT if any error occurs. */
48
49 extern int target_read_uint32 (CORE_ADDR memaddr, uint32_t *result);
50
51 /* Write LEN bytes from MYADDR to target memory at address MEMADDR.
52 Return zero for success, nonzero if any error occurs. This
53 function must be provided by the client. Implementations of this
54 function may define and use their own error codes, but functions
55 in the common, nat and target directories must treat the return
56 code as opaque. No guarantee is made about the contents of the
57 data at MEMADDR if any error occurs. */
58
59 extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
60 ssize_t len);
61
62 /* Make target stop in a continuable fashion. (For instance, under
63 Unix, this should act like SIGSTOP). This function must be
64 provided by the client. */
65
66 extern void target_stop_ptid (ptid_t ptid);
67
68 /* Restart a target that was previously stopped by target_stop_ptid.
69 This function must be provided by the client. */
70
71 extern void target_continue_ptid (ptid_t ptid);
72
73 #endif /* TARGET_COMMON_H */
This page took 0.03143 seconds and 4 git commands to generate.