| 1 | /* Remote target communications for serial-line targets in custom GDB protocol |
| 2 | Copyright (C) 1999, 2003, 2004, 2005, 2006, 2007 |
| 3 | Free Software Foundation, Inc. |
| 4 | |
| 5 | This file is part of GDB. |
| 6 | |
| 7 | This program is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 2 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
| 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with this program; if not, write to the Free Software |
| 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 | Boston, MA 02110-1301, USA. */ |
| 21 | |
| 22 | #ifndef REMOTE_H |
| 23 | #define REMOTE_H |
| 24 | |
| 25 | struct target_desc; |
| 26 | |
| 27 | /* FIXME?: move this interface down to tgt vector) */ |
| 28 | |
| 29 | /* Read a packet from the remote machine, with error checking, and |
| 30 | store it in *BUF. Resize *BUF using xrealloc if necessary to hold |
| 31 | the result, and update *SIZEOF_BUF. If FOREVER, wait forever |
| 32 | rather than timing out; this is used (in synchronous mode) to wait |
| 33 | for a target that is is executing user code to stop. */ |
| 34 | |
| 35 | extern void getpkt (char **buf, long *sizeof_buf, int forever); |
| 36 | |
| 37 | /* Send a packet to the remote machine, with error checking. The data |
| 38 | of the packet is in BUF. The string in BUF can be at most PBUFSIZ |
| 39 | - 5 to account for the $, # and checksum, and for a possible /0 if |
| 40 | we are debugging (remote_debug) and want to print the sent packet |
| 41 | as a string */ |
| 42 | |
| 43 | extern int putpkt (char *buf); |
| 44 | |
| 45 | /* Send HEX encoded string to the target console. (gdb_stdtarg) */ |
| 46 | |
| 47 | extern void remote_console_output (char *); |
| 48 | |
| 49 | |
| 50 | /* FIXME: cagney/1999-09-20: The remote cisco stuff in remote.c needs |
| 51 | to be broken out into a separate file (remote-cisco.[hc]?). Before |
| 52 | that can happen, a remote protocol stack framework needs to be |
| 53 | implemented. */ |
| 54 | |
| 55 | extern void remote_cisco_objfile_relocate (bfd_signed_vma text_off, |
| 56 | bfd_signed_vma data_off, |
| 57 | bfd_signed_vma bss_off); |
| 58 | |
| 59 | extern void async_remote_interrupt_twice (void *arg); |
| 60 | |
| 61 | extern int remote_write_bytes (CORE_ADDR memaddr, const gdb_byte *myaddr, |
| 62 | int len); |
| 63 | |
| 64 | extern int remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len); |
| 65 | |
| 66 | extern void (*deprecated_target_resume_hook) (void); |
| 67 | extern void (*deprecated_target_wait_loop_hook) (void); |
| 68 | |
| 69 | void register_remote_g_packet_guess (struct gdbarch *gdbarch, int bytes, |
| 70 | const struct target_desc *tdesc); |
| 71 | |
| 72 | #endif |