remote-utils.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Remote utility routines for the remote server for GDB.
  2. Copyright (C) 1993-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef GDBSERVER_REMOTE_UTILS_H
  15. #define GDBSERVER_REMOTE_UTILS_H
  16. int gdb_connected (void);
  17. #define STDIO_CONNECTION_NAME "stdio"
  18. int remote_connection_is_stdio (void);
  19. ptid_t read_ptid (const char *buf, const char **obuf);
  20. char *write_ptid (char *buf, ptid_t ptid);
  21. int putpkt (char *buf);
  22. int putpkt_binary (char *buf, int len);
  23. int putpkt_notif (char *buf);
  24. int getpkt (char *buf);
  25. void remote_prepare (const char *name);
  26. void remote_open (const char *name);
  27. void remote_close (void);
  28. void write_ok (char *buf);
  29. void write_enn (char *buf);
  30. void initialize_async_io (void);
  31. void enable_async_io (void);
  32. void disable_async_io (void);
  33. void check_remote_input_interrupt_request (void);
  34. void prepare_resume_reply (char *buf, ptid_t ptid,
  35. const target_waitstatus &status);
  36. const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start);
  37. void decode_address (CORE_ADDR *addrp, const char *start, int len);
  38. /* Given an input string FROM, decode MEM_ADDR_PTR, a memory address in hex
  39. form, and LEN_PTR, a length argument in hex form, from the pattern
  40. "<MEM_ADDR_PTR>,<LEN_PTR><END_MARKER>", with END_MARKER being an end marker
  41. character. */
  42. const char *decode_m_packet_params (const char *from, CORE_ADDR *mem_addr_ptr,
  43. unsigned int *len_ptr,
  44. const char end_marker);
  45. void decode_m_packet (const char *from, CORE_ADDR * mem_addr_ptr,
  46. unsigned int *len_ptr);
  47. void decode_M_packet (const char *from, CORE_ADDR * mem_addr_ptr,
  48. unsigned int *len_ptr, unsigned char **to_p);
  49. int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr,
  50. unsigned int *len_ptr, unsigned char **to_p);
  51. int decode_xfer_write (char *buf, int packet_len,
  52. CORE_ADDR *offset, unsigned int *len,
  53. unsigned char *data);
  54. int decode_search_memory_packet (const char *buf, int packet_len,
  55. CORE_ADDR *start_addrp,
  56. CORE_ADDR *search_space_lenp,
  57. gdb_byte *pattern,
  58. unsigned int *pattern_lenp);
  59. void clear_symbol_cache (struct sym_cache **symcache_p);
  60. int look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb);
  61. int relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc);
  62. void monitor_output (const char *msg);
  63. #endif /* GDBSERVER_REMOTE_UTILS_H */