GDBserver

remote-utils.h
Go to the documentation of this file.
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 extern int noack_mode;
24 extern int transport_is_reliable;
25
26 int gdb_connected (void);
27
28 #define STDIO_CONNECTION_NAME "stdio"
29 int remote_connection_is_stdio (void);
30
31 ptid_t read_ptid (const char *buf, const char **obuf);
32 char *write_ptid (char *buf, ptid_t ptid);
33
34 int putpkt (char *buf);
35 int putpkt_binary (char *buf, int len);
36 int putpkt_notif (char *buf);
37 int getpkt (char *buf);
38 void remote_prepare (const char *name);
39 void remote_open (const char *name);
40 void remote_close (void);
41 void write_ok (char *buf);
42 void write_enn (char *buf);
43 void initialize_async_io (void);
44 void enable_async_io (void);
45 void disable_async_io (void);
46 void check_remote_input_interrupt_request (void);
47 void prepare_resume_reply (char *buf, ptid_t ptid,
48 struct target_waitstatus *status);
49
50 const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start);
51 void decode_address (CORE_ADDR *addrp, const char *start, int len);
52 void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
53 unsigned int *len_ptr);
54 void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
55 unsigned int *len_ptr, unsigned char **to_p);
56 int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr,
57 unsigned int *len_ptr, unsigned char **to_p);
58 int decode_xfer_write (char *buf, int packet_len,
59 CORE_ADDR *offset, unsigned int *len,
60 unsigned char *data);
61 int decode_search_memory_packet (const char *buf, int packet_len,
62 CORE_ADDR *start_addrp,
63 CORE_ADDR *search_space_lenp,
64 gdb_byte *pattern,
65 unsigned int *pattern_lenp);
66
67 void clear_symbol_cache (struct sym_cache **symcache_p);
68 int look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb);
69
70 int relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc);
71
72 void monitor_output (const char *msg);
73
74 #endif /* REMOTE_UTILS_H */
write_ptid
char * write_ptid(char *buf, ptid_t ptid)
Definition: remote-utils.c:486
remote_open
void remote_open(const char *name)
Definition: remote-utils.c:290
noack_mode
int noack_mode
Definition: remote-utils.c:119
decode_M_packet
void decode_M_packet(char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr, unsigned char **to_p)
Definition: remote-utils.c:1309
CORE_ADDR
bfd_vma CORE_ADDR
Definition: common-types.h:41
decode_m_packet
void decode_m_packet(char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr)
Definition: remote-utils.c:1287
check_remote_input_interrupt_request
void check_remote_input_interrupt_request(void)
Definition: remote-utils.c:745
name
const char * name
Definition: tracepoint.c:180
sym_cache
Definition: remote-utils.c:99
clear_symbol_cache
void clear_symbol_cache(struct sym_cache **symcache_p)
Definition: remote-utils.c:1417
decode_X_packet
int decode_X_packet(char *from, int packet_len, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr, unsigned char **to_p)
Definition: remote-utils.c:1335
putpkt_notif
int putpkt_notif(char *buf)
Definition: remote-utils.c:695
putpkt_binary
int putpkt_binary(char *buf, int len)
Definition: remote-utils.c:679
monitor_output
void monitor_output(const char *msg)
Definition: remote-utils.c:1630
ptid_t
Definition: ptid.h:35
offset
int offset
Definition: tracepoint.c:181
gdb_connected
int gdb_connected(void)
Definition: remote-utils.c:129
remote_close
void remote_close(void)
Definition: remote-utils.c:377
transport_is_reliable
int transport_is_reliable
Definition: remote-utils.c:121
disable_async_io
void disable_async_io(void)
Definition: remote-utils.c:814
relocate_instruction
int relocate_instruction(CORE_ADDR *to, CORE_ADDR oldloc)
Definition: remote-utils.c:1549
write_enn
void write_enn(char *buf)
Definition: remote-utils.c:1050
putpkt
int putpkt(char *buf)
Definition: remote-utils.c:689
decode_address_to_semicolon
const char * decode_address_to_semicolon(CORE_ADDR *addrp, const char *start)
Definition: remote-utils.c:416
gdb_byte
bfd_byte gdb_byte
Definition: common-types.h:38
remote_debug
int remote_debug
Definition: remote-utils.c:106
read_ptid
ptid_t read_ptid(const char *buf, const char **obuf)
Definition: remote-utils.c:529
decode_xfer_write
int decode_xfer_write(char *buf, int packet_len, CORE_ADDR *offset, unsigned int *len, unsigned char *data)
Definition: remote-utils.c:1367
getpkt
int getpkt(char *buf)
Definition: remote-utils.c:927
look_up_one_symbol
int look_up_one_symbol(const char *name, CORE_ADDR *addrp, int may_ask_gdb)
Definition: remote-utils.c:1436
remote_connection_is_stdio
int remote_connection_is_stdio(void)
Definition: remote-utils.c:137
remote_prepare
void remote_prepare(const char *name)
Definition: remote-utils.c:223
initialize_async_io
void initialize_async_io(void)
Definition: remote-utils.c:829
write_ok
void write_ok(char *buf)
Definition: remote-utils.c:1042
prepare_resume_reply
void prepare_resume_reply(char *buf, ptid_t ptid, struct target_waitstatus *status)
Definition: remote-utils.c:1081
decode_search_memory_packet
int decode_search_memory_packet(const char *buf, int packet_len, CORE_ADDR *start_addrp, CORE_ADDR *search_space_lenp, gdb_byte *pattern, unsigned int *pattern_lenp)
Definition: remote-utils.c:1391
enable_async_io
void enable_async_io(void)
Definition: remote-utils.c:799
decode_address
void decode_address(CORE_ADDR *addrp, const char *start, int len)
Definition: remote-utils.c:399