Move linux_find_memory_regions_full & co.
[deliverable/binutils-gdb.git] / gdb / target / target.h
CommitLineData
721ec300
GB
1/* Declarations for common target functions.
2
32d0add0 3 Copyright (C) 1986-2015 Free Software Foundation, Inc.
721ec300
GB
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"
721ec300
GB
24/* This header is a stopgap until more code is shared. */
25
26/* Read LEN bytes of target memory at address MEMADDR, placing the
27 results in GDB's memory at MYADDR. Return zero for success,
28 nonzero if any error occurs. This function must be provided by
29 the client. Implementations of this function may define and use
30 their own error codes, but functions in the common, nat and target
31 directories must treat the return code as opaque. No guarantee is
32 made about the contents of the data at MYADDR if any error
33 occurs. */
34
35extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
36 ssize_t len);
37
38/* Read an unsigned 32-bit integer in the target's format from target
39 memory at address MEMADDR, storing the result in GDB's format in
40 GDB's memory at RESULT. Return zero for success, nonzero if any
41 error occurs. This function must be provided by the client.
42 Implementations of this function may define and use their own error
43 codes, but functions in the common, nat and target directories must
44 treat the return code as opaque. No guarantee is made about the
45 contents of the data at RESULT if any error occurs. */
46
47extern int target_read_uint32 (CORE_ADDR memaddr, uint32_t *result);
48
49/* Write LEN bytes from MYADDR to target memory at address MEMADDR.
50 Return zero for success, nonzero if any error occurs. This
51 function must be provided by the client. Implementations of this
52 function may define and use their own error codes, but functions
53 in the common, nat and target directories must treat the return
54 code as opaque. No guarantee is made about the contents of the
55 data at MEMADDR if any error occurs. */
56
57extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
58 ssize_t len);
59
03f4463b
GB
60/* Cause the target to stop in a continuable fashion--for instance,
61 under Unix, this should act like SIGSTOP--and wait for the target
62 to be stopped before returning. This function must be provided by
63 the client. */
f8c1d06b 64
03f4463b 65extern void target_stop_and_wait (ptid_t ptid);
f8c1d06b 66
03f4463b
GB
67/* Restart a target previously stopped by target_stop_and_wait.
68 No signal is delivered to the target. This function must be
69 provided by the client. */
f8c1d06b 70
03f4463b 71extern void target_continue_no_signal (ptid_t ptid);
f8c1d06b 72
9904185c
JK
73/* Read target file FILENAME, in the filesystem as seen by INF. If
74 INF is NULL, use the filesystem seen by the debugger (GDB or, for
75 remote targets, the remote stub). The result is NUL-terminated and
76 returned as a string, allocated using xmalloc. If an error occurs
77 or the transfer is unsupported, NULL is returned. Empty objects
78 are returned as allocated but empty strings. A warning is issued
79 if the result contains any embedded NUL bytes. */
80struct inferior;
81extern char *target_fileio_read_stralloc (struct inferior *inf,
82 const char *filename);
83
721ec300 84#endif /* TARGET_COMMON_H */
This page took 0.127489 seconds and 4 git commands to generate.