aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/remote-utils.h
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2020-06-15 15:34:06 -0300
committerLuis Machado <luis.machado@linaro.org>2021-03-24 14:49:21 -0300
commit546b77fe78bb366bbec3c708ac371e2f553bbdae (patch)
tree83e9a4964c5abe2fce9a3f17de88e257b1533886 /gdbserver/remote-utils.h
parent754487e200deb9fad3399556e838bb68eedbab18 (diff)
downloadgdb-546b77fe78bb366bbec3c708ac371e2f553bbdae.zip
gdb-546b77fe78bb366bbec3c708ac371e2f553bbdae.tar.gz
gdb-546b77fe78bb366bbec3c708ac371e2f553bbdae.tar.bz2
GDBserver remote packet support for memory tagging
This patch adds the generic remote bits to gdbserver so it can check for memory tagging support and handle fetch tags and store tags requests. gdbserver/ChangeLog: 2021-03-24 Luis Machado <luis.machado@linaro.org> * remote-utils.cc (decode_m_packet_params): Renamed from ... (decode_m_packet): ... this, which now calls decode_m_packet_params. Make char * param/return const char *. (decode_M_packet): Use decode_m_packet_params and make char * param const char *. * remote-utils.h (decode_m_packet_params): New prototype. (decode_m_packet): Constify char pointers. (decode_M_packet): Likewise. * server.cc (create_fetch_memtags_reply) (parse_store_memtags_request): New functions. (handle_general_set): Handle the QMemTags packet. (parse_fetch_memtags_request): New function. (handle_query): Handle the qMemTags packet and advertise memory tagging support. (captured_main): Initialize memory tagging flag. * server.h (struct client_state): Initialize memory tagging flag. * target.cc (process_stratum_target::supports_memory_tagging) (process_stratum_target::fetch_memtags) (process_stratum_target::store_memtags): New methods. * target.h: Include gdbsupport/byte-vector.h. (class process_stratum_target) <supports_memory_tagging> <fetch_memtags, store_memtags>: New class virtual methods. (target_supports_memory_tagging): Define.
Diffstat (limited to 'gdbserver/remote-utils.h')
-rw-r--r--gdbserver/remote-utils.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gdbserver/remote-utils.h b/gdbserver/remote-utils.h
index 5a8e764..25074bc 100644
--- a/gdbserver/remote-utils.h
+++ b/gdbserver/remote-utils.h
@@ -45,9 +45,17 @@ void prepare_resume_reply (char *buf, ptid_t ptid,
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,
+
+/* Given an input string FROM, decode MEM_ADDR_PTR, a memory address in hex
+ form, and LEN_PTR, a length argument in hex form, from the pattern
+ "<MEM_ADDR_PTR>,<LEN_PTR><END_MARKER>", with END_MARKER being an end marker
+ character. */
+const char *decode_m_packet_params (const char *from, CORE_ADDR *mem_addr_ptr,
+ unsigned int *len_ptr,
+ const char end_marker);
+void decode_m_packet (const char *from, CORE_ADDR * mem_addr_ptr,
unsigned int *len_ptr);
-void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
+void decode_M_packet (const 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);