GDBserver: Pass process_info pointer to target_detach and target_join
[binutils-gdb.git] / gdb / gdbserver / remote-utils.h
1 /* Remote utility routines for the remote server for GDB.
2 Copyright (C) 1993-2018 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19 #ifndef REMOTE_UTILS_H
20 #define REMOTE_UTILS_H
21
22 extern int remote_debug;
23
24 int gdb_connected (void);
25
26 #define STDIO_CONNECTION_NAME "stdio"
27 int remote_connection_is_stdio (void);
28
29 ptid_t read_ptid (const char *buf, const char **obuf);
30 char *write_ptid (char *buf, ptid_t ptid);
31
32 int putpkt (char *buf);
33 int putpkt_binary (char *buf, int len);
34 int putpkt_notif (char *buf);
35 int getpkt (char *buf);
36 void remote_prepare (const char *name);
37 void remote_open (const char *name);
38 void remote_close (void);
39 void write_ok (char *buf);
40 void write_enn (char *buf);
41 void initialize_async_io (void);
42 void enable_async_io (void);
43 void disable_async_io (void);
44 void check_remote_input_interrupt_request (void);
45 void prepare_resume_reply (char *buf, ptid_t ptid,
46 struct target_waitstatus *status);
47
48 const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start);
49 void decode_address (CORE_ADDR *addrp, const char *start, int len);
50 void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
51 unsigned int *len_ptr);
52 void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
53 unsigned int *len_ptr, unsigned char **to_p);
54 int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr,
55 unsigned int *len_ptr, unsigned char **to_p);
56 int decode_xfer_write (char *buf, int packet_len,
57 CORE_ADDR *offset, unsigned int *len,
58 unsigned char *data);
59 int decode_search_memory_packet (const char *buf, int packet_len,
60 CORE_ADDR *start_addrp,
61 CORE_ADDR *search_space_lenp,
62 gdb_byte *pattern,
63 unsigned int *pattern_lenp);
64
65 void clear_symbol_cache (struct sym_cache **symcache_p);
66 int look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb);
67
68 int relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc);
69
70 void monitor_output (const char *msg);
71
72 #endif /* REMOTE_UTILS_H */