aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.h
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2021-08-31 14:04:36 +0100
committerAndrew Burgess <aburgess@redhat.com>2021-11-30 12:10:40 +0000
commit24b2de7b776f8f23788d855b1eec290c6e208821 (patch)
tree9a2d7b705087364d8e4ce6585bf6f7ad39664004 /gdb/remote.h
parente5b176f25ff51f6811b82f549b7524618d5c2f6b (diff)
downloadgdb-24b2de7b776f8f23788d855b1eec290c6e208821.zip
gdb-24b2de7b776f8f23788d855b1eec290c6e208821.tar.gz
gdb-24b2de7b776f8f23788d855b1eec290c6e208821.tar.bz2
gdb/python: add gdb.RemoteTargetConnection.send_packet
This commits adds a new sub-class of gdb.TargetConnection, gdb.RemoteTargetConnection. This sub-class is created for all 'remote' and 'extended-remote' targets. This new sub-class has one additional method over its base class, 'send_packet'. This new method is equivalent to the 'maint packet' CLI command, it allows a custom packet to be sent to a remote target. The outgoing packet can either be a bytes object, or a Unicode string, so long as the Unicode string contains only ASCII characters. The result of calling RemoteTargetConnection.send_packet is a bytes object containing the reply that came from the remote.
Diffstat (limited to 'gdb/remote.h')
-rw-r--r--gdb/remote.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/remote.h b/gdb/remote.h
index 0178294..0ddf55d 100644
--- a/gdb/remote.h
+++ b/gdb/remote.h
@@ -24,6 +24,8 @@
struct target_desc;
struct remote_target;
+class process_stratum_target;
+
/* True when printing "remote" debug statements is enabled. */
extern bool remote_debug;
@@ -113,4 +115,10 @@ struct send_remote_packet_callbacks
extern void send_remote_packet (gdb::array_view<const char> &buf,
send_remote_packet_callbacks *callbacks);
+
+/* Return true if TARGET is a remote, or extended-remote target, otherwise,
+ return false. */
+
+extern bool is_remote_target (process_stratum_target *target);
+
#endif