15796c8dcSSimon Schubert /* Remote target communications for serial-line targets in custom GDB protocol 2*ef5ccd6cSJohn Marino Copyright (C) 1999-2013 Free Software Foundation, Inc. 35796c8dcSSimon Schubert 45796c8dcSSimon Schubert This file is part of GDB. 55796c8dcSSimon Schubert 65796c8dcSSimon Schubert This program is free software; you can redistribute it and/or modify 75796c8dcSSimon Schubert it under the terms of the GNU General Public License as published by 85796c8dcSSimon Schubert the Free Software Foundation; either version 3 of the License, or 95796c8dcSSimon Schubert (at your option) any later version. 105796c8dcSSimon Schubert 115796c8dcSSimon Schubert This program is distributed in the hope that it will be useful, 125796c8dcSSimon Schubert but WITHOUT ANY WARRANTY; without even the implied warranty of 135796c8dcSSimon Schubert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 145796c8dcSSimon Schubert GNU General Public License for more details. 155796c8dcSSimon Schubert 165796c8dcSSimon Schubert You should have received a copy of the GNU General Public License 175796c8dcSSimon Schubert along with this program. If not, see <http://www.gnu.org/licenses/>. */ 185796c8dcSSimon Schubert 195796c8dcSSimon Schubert #ifndef REMOTE_H 205796c8dcSSimon Schubert #define REMOTE_H 215796c8dcSSimon Schubert 22*ef5ccd6cSJohn Marino #include "remote-notif.h" 23*ef5ccd6cSJohn Marino 245796c8dcSSimon Schubert struct target_desc; 255796c8dcSSimon Schubert 265796c8dcSSimon Schubert /* Read a packet from the remote machine, with error checking, and 275796c8dcSSimon Schubert store it in *BUF. Resize *BUF using xrealloc if necessary to hold 285796c8dcSSimon Schubert the result, and update *SIZEOF_BUF. If FOREVER, wait forever 295796c8dcSSimon Schubert rather than timing out; this is used (in synchronous mode) to wait 305796c8dcSSimon Schubert for a target that is is executing user code to stop. */ 315796c8dcSSimon Schubert 325796c8dcSSimon Schubert extern void getpkt (char **buf, long *sizeof_buf, int forever); 335796c8dcSSimon Schubert 345796c8dcSSimon Schubert /* Send a packet to the remote machine, with error checking. The data 355796c8dcSSimon Schubert of the packet is in BUF. The string in BUF can be at most PBUFSIZ 365796c8dcSSimon Schubert - 5 to account for the $, # and checksum, and for a possible /0 if 375796c8dcSSimon Schubert we are debugging (remote_debug) and want to print the sent packet 38c50c785cSJohn Marino as a string. */ 395796c8dcSSimon Schubert 405796c8dcSSimon Schubert extern int putpkt (char *buf); 415796c8dcSSimon Schubert 42*ef5ccd6cSJohn Marino extern int hex2bin (const char *hex, gdb_byte *bin, int count); 43*ef5ccd6cSJohn Marino 44*ef5ccd6cSJohn Marino extern int bin2hex (const gdb_byte *bin, char *hex, int count); 45*ef5ccd6cSJohn Marino 46cf7f2e2dSJohn Marino extern char *unpack_varlen_hex (char *buff, ULONGEST *result); 475796c8dcSSimon Schubert 485796c8dcSSimon Schubert extern void async_remote_interrupt_twice (void *arg); 495796c8dcSSimon Schubert 505796c8dcSSimon Schubert void register_remote_g_packet_guess (struct gdbarch *gdbarch, int bytes, 515796c8dcSSimon Schubert const struct target_desc *tdesc); 52cf7f2e2dSJohn Marino void register_remote_support_xml (const char *); 535796c8dcSSimon Schubert 545796c8dcSSimon Schubert void remote_file_put (const char *local_file, const char *remote_file, 555796c8dcSSimon Schubert int from_tty); 565796c8dcSSimon Schubert void remote_file_get (const char *remote_file, const char *local_file, 575796c8dcSSimon Schubert int from_tty); 585796c8dcSSimon Schubert void remote_file_delete (const char *remote_file, int from_tty); 595796c8dcSSimon Schubert 605796c8dcSSimon Schubert bfd *remote_bfd_open (const char *remote_file, const char *target); 615796c8dcSSimon Schubert 625796c8dcSSimon Schubert int remote_filename_p (const char *filename); 635796c8dcSSimon Schubert 64a45ae5f8SJohn Marino extern int remote_register_number_and_offset (struct gdbarch *gdbarch, 65a45ae5f8SJohn Marino int regnum, int *pnum, 66a45ae5f8SJohn Marino int *poffset); 67a45ae5f8SJohn Marino 68*ef5ccd6cSJohn Marino extern void remote_notif_get_pending_events (struct notif_client *np); 695796c8dcSSimon Schubert #endif 70