GDBserver
|
00001 /* Remote utility routines for the remote server for GDB. 00002 Copyright (C) 1993-2013 Free Software Foundation, Inc. 00003 00004 This file is part of GDB. 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00018 00019 #ifndef REMOTE_UTILS_H 00020 #define REMOTE_UTILS_H 00021 00022 extern int remote_debug; 00023 extern int noack_mode; 00024 extern int transport_is_reliable; 00025 00026 int gdb_connected (void); 00027 00028 #define STDIO_CONNECTION_NAME "stdio" 00029 int remote_connection_is_stdio (void); 00030 00031 ptid_t read_ptid (char *buf, char **obuf); 00032 char *write_ptid (char *buf, ptid_t ptid); 00033 00034 int putpkt (char *buf); 00035 int putpkt_binary (char *buf, int len); 00036 int putpkt_notif (char *buf); 00037 int getpkt (char *buf); 00038 void remote_prepare (char *name); 00039 void remote_open (char *name); 00040 void remote_close (void); 00041 void write_ok (char *buf); 00042 void write_enn (char *buf); 00043 void initialize_async_io (void); 00044 void enable_async_io (void); 00045 void disable_async_io (void); 00046 void check_remote_input_interrupt_request (void); 00047 void convert_ascii_to_int (const char *from, unsigned char *to, int n); 00048 void convert_int_to_ascii (const unsigned char *from, char *to, int n); 00049 void new_thread_notify (int id); 00050 void dead_thread_notify (int id); 00051 void prepare_resume_reply (char *buf, ptid_t ptid, 00052 struct target_waitstatus *status); 00053 00054 const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start); 00055 void decode_address (CORE_ADDR *addrp, const char *start, int len); 00056 void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr, 00057 unsigned int *len_ptr); 00058 void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr, 00059 unsigned int *len_ptr, unsigned char **to_p); 00060 int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr, 00061 unsigned int *len_ptr, unsigned char **to_p); 00062 int decode_xfer_write (char *buf, int packet_len, 00063 CORE_ADDR *offset, unsigned int *len, 00064 unsigned char *data); 00065 int decode_search_memory_packet (const char *buf, int packet_len, 00066 CORE_ADDR *start_addrp, 00067 CORE_ADDR *search_space_lenp, 00068 gdb_byte *pattern, 00069 unsigned int *pattern_lenp); 00070 00071 int unhexify (char *bin, const char *hex, int count); 00072 int hexify (char *hex, const char *bin, int count); 00073 int remote_escape_output (const gdb_byte *buffer, int len, 00074 gdb_byte *out_buf, int *out_len, 00075 int out_maxlen); 00076 char *unpack_varlen_hex (char *buff, ULONGEST *result); 00077 00078 void clear_symbol_cache (struct sym_cache **symcache_p); 00079 int look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb); 00080 00081 int relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc); 00082 00083 void monitor_output (const char *msg); 00084 00085 #endif /* REMOTE_UTILS_H */