mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-01 22:34:22 +08:00
9c3d65319a
This moves various low-level remote serial protocol bits into common/rsp-low.[ch]. This is as close to a pure move as possible. There are some redundancies remaining but those will be dealt with in a subsequent patch. Note that the two variants of remote_escape_output disagreed on the treatment of "*". On the theory that quoting cannot hurt but the absence possibly can, I chose the gdbserver variant to be the canonical one. 2014-02-12 Tom Tromey <tromey@redhat.com> * tracepoint.c: Include rsp-low.h. * remote.h (hex2bin, bin2hex, unpack_varlen_hex): Don't declare. * remote.c: Include rsp-low.h. (hexchars, ishex, unpack_varlen_hex, pack_nibble, pack_hex_byte) (fromhex, hex2bin, tohex, bin2hex, remote_escape_output) (remote_unescape_input): Move to common/rsp-low.c. * common/rsp-low.h: New file. * common/rsp-low.c: New file. * Makefile.in (SFILES): Add common/rsp-low.c. (HFILES_NO_SRCDIR): Add common/rsp-low.h. (COMMON_OBS): Add rsp-low.o. (rsp-low.o): New target. 2014-02-12 Tom Tromey <tromey@redhat.com> * tracepoint.c: Include rsp-low.h. * server.c: Include rsp-low.h. * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii) (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't declare. * remote-utils.c: Include rsp-low.h. (fromhex, hexchars, ishex, unhexify, tohex, hexify) (remote_escape_output, remote_unescape_input, unpack_varlen_hex) (convert_int_to_ascii, convert_ascii_to_int): Move to common/rsp-low.c. * regcache.c: Include rsp-low.h. * ax.c: Include rsp-low.h. * Makefile.in (SFILES): Add common/rsp-low.c. (OBS): Add rsp-low.o. (rsp-low.o): New target.
77 lines
2.7 KiB
C
77 lines
2.7 KiB
C
/* Remote utility routines for the remote server for GDB.
|
|
Copyright (C) 1993-2014 Free Software Foundation, Inc.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef REMOTE_UTILS_H
|
|
#define REMOTE_UTILS_H
|
|
|
|
extern int remote_debug;
|
|
extern int noack_mode;
|
|
extern int transport_is_reliable;
|
|
|
|
int gdb_connected (void);
|
|
|
|
#define STDIO_CONNECTION_NAME "stdio"
|
|
int remote_connection_is_stdio (void);
|
|
|
|
ptid_t read_ptid (char *buf, char **obuf);
|
|
char *write_ptid (char *buf, ptid_t ptid);
|
|
|
|
int putpkt (char *buf);
|
|
int putpkt_binary (char *buf, int len);
|
|
int putpkt_notif (char *buf);
|
|
int getpkt (char *buf);
|
|
void remote_prepare (char *name);
|
|
void remote_open (char *name);
|
|
void remote_close (void);
|
|
void write_ok (char *buf);
|
|
void write_enn (char *buf);
|
|
void initialize_async_io (void);
|
|
void enable_async_io (void);
|
|
void disable_async_io (void);
|
|
void check_remote_input_interrupt_request (void);
|
|
void new_thread_notify (int id);
|
|
void dead_thread_notify (int id);
|
|
void prepare_resume_reply (char *buf, ptid_t ptid,
|
|
struct target_waitstatus *status);
|
|
|
|
const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start);
|
|
void decode_address (CORE_ADDR *addrp, const char *start, int len);
|
|
void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
|
|
unsigned int *len_ptr);
|
|
void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
|
|
unsigned int *len_ptr, unsigned char **to_p);
|
|
int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr,
|
|
unsigned int *len_ptr, unsigned char **to_p);
|
|
int decode_xfer_write (char *buf, int packet_len,
|
|
CORE_ADDR *offset, unsigned int *len,
|
|
unsigned char *data);
|
|
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);
|
|
|
|
void clear_symbol_cache (struct sym_cache **symcache_p);
|
|
int look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb);
|
|
|
|
int relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc);
|
|
|
|
void monitor_output (const char *msg);
|
|
|
|
#endif /* REMOTE_UTILS_H */
|