]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbserver: do not announce static tracepoint support
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Tue, 14 Jan 2025 09:10:30 +0000 (10:10 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Tue, 14 Jan 2025 09:27:58 +0000 (10:27 +0100)
Remove the announcement that `qXfer:statictrace:read` and
`StaticTracepoints` are supported.  Associated to this, remove the
handling of "qTfSTM", "qTsSTM", and "qTSTMat" packets and the
qXfer:statictrace:read handling.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdbserver/server.cc
gdbserver/tracepoint.cc
gdbserver/tracepoint.h

index 55898f59556b2d16bebe319e48321cdfb0cc9f89..bc591599b0299fe5257e0ca779b6ad1a46703b34 100644 (file)
@@ -1965,29 +1965,6 @@ handle_qxfer_siginfo (const char *annex,
   return the_target->qxfer_siginfo (annex, readbuf, writebuf, offset, len);
 }
 
-/* Handle qXfer:statictrace:read.  */
-
-static int
-handle_qxfer_statictrace (const char *annex,
-                         gdb_byte *readbuf, const gdb_byte *writebuf,
-                         ULONGEST offset, LONGEST len)
-{
-  client_state &cs = get_client_state ();
-  ULONGEST nbytes;
-
-  if (writebuf != NULL)
-    return -2;
-
-  if (annex[0] != '\0' || current_thread == NULL 
-      || cs.current_traceframe == -1)
-    return -1;
-
-  if (traceframe_read_sdata (cs.current_traceframe, offset,
-                            readbuf, len, &nbytes))
-    return -1;
-  return nbytes;
-}
-
 /* Helper for handle_qxfer_threads_proper.
    Emit the XML to describe the thread of INF.  */
 
@@ -2324,7 +2301,6 @@ static const struct qxfer qxfer_packets[] =
     { "libraries-svr4", handle_qxfer_libraries_svr4 },
     { "osdata", handle_qxfer_osdata },
     { "siginfo", handle_qxfer_siginfo },
-    { "statictrace", handle_qxfer_statictrace },
     { "threads", handle_qxfer_threads },
     { "traceframe-info", handle_qxfer_traceframe_info },
   };
@@ -2842,9 +2818,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
          strcat (own_buf, ";DisconnectedTracing+");
          if (gdb_supports_qRelocInsn && target_supports_fast_tracepoints ())
            strcat (own_buf, ";FastTracepoints+");
-         strcat (own_buf, ";StaticTracepoints+");
          strcat (own_buf, ";InstallInTrace+");
-         strcat (own_buf, ";qXfer:statictrace:read+");
          strcat (own_buf, ";qXfer:traceframe-info:read+");
          strcat (own_buf, ";EnableDisableTracepoints+");
          strcat (own_buf, ";QTBuffer:size+");
index 8b50330276346ea5d199c92fd4a5b16faea8e21b..46fff32662213e5b3bb0efb5479a873ca8a32957 100644 (file)
@@ -3791,33 +3791,6 @@ cmd_qtsv (char *packet)
     strcpy (packet, "l");
 }
 
-/* Return the first static tracepoint marker, and initialize the state
-   machine that will iterate through all the static tracepoints
-   markers.  */
-
-static void
-cmd_qtfstm (char *packet)
-{
-  write_e_static_tracepoints_not_supported (packet);
-}
-
-/* Return additional static tracepoints markers.  */
-
-static void
-cmd_qtsstm (char *packet)
-{
-  write_e_static_tracepoints_not_supported (packet);
-}
-
-/* Return the definition of the static tracepoint at a given address.
-   Result packet is the same as qTsST's.  */
-
-static void
-cmd_qtstmat (char *packet)
-{
-  write_e_static_tracepoints_not_supported (packet);
-}
-
 /* Sent the agent a command to close it.  */
 
 void
@@ -4133,21 +4106,6 @@ handle_tracepoint_query (char *packet)
       cmd_qtbuffer (packet);
       return 1;
     }
-  else if (strcmp ("qTfSTM", packet) == 0)
-    {
-      cmd_qtfstm (packet);
-      return 1;
-    }
-  else if (strcmp ("qTsSTM", packet) == 0)
-    {
-      cmd_qtsstm (packet);
-      return 1;
-    }
-  else if (startswith (packet, "qTSTMat:"))
-    {
-      cmd_qtstmat (packet);
-      return 1;
-    }
   else if (strcmp ("qTMinFTPILen", packet) == 0)
     {
       cmd_qtminftpilen (packet);
@@ -5176,59 +5134,6 @@ traceframe_read_tsv (int tsvnum, LONGEST *val)
   return !found;
 }
 
-/* Read a requested block of static tracepoint data from a trace
-   frame.  */
-
-int
-traceframe_read_sdata (int tfnum, ULONGEST offset,
-                      unsigned char *buf, ULONGEST length,
-                      ULONGEST *nbytes)
-{
-  struct traceframe *tframe;
-  unsigned char *database, *dataptr;
-  unsigned int datasize;
-  unsigned short mlen;
-
-  trace_debug ("traceframe_read_sdata");
-
-  tframe = find_traceframe (tfnum);
-
-  if (!tframe)
-    {
-      trace_debug ("traceframe %d not found", tfnum);
-      return 1;
-    }
-
-  datasize = tframe->data_size;
-  database = &tframe->data[0];
-
-  /* Iterate through a traceframe's blocks, looking for static
-     tracepoint data.  */
-  dataptr = traceframe_find_block_type (database, datasize,
-                                       tfnum, 'S');
-  if (dataptr != NULL)
-    {
-      memcpy (&mlen, dataptr, sizeof (mlen));
-      dataptr += sizeof (mlen);
-      if (offset < mlen)
-       {
-         if (offset + length > mlen)
-           length = mlen - offset;
-
-         memcpy (buf, dataptr, length);
-         *nbytes = length;
-       }
-      else
-       *nbytes = 0;
-      return 0;
-    }
-
-  trace_debug ("traceframe %d has no static trace data", tfnum);
-
-  *nbytes = 0;
-  return 0;
-}
-
 /* Callback for traceframe_walk_blocks.  Builds a traceframe-info
    object.  DATA is pointer to a string holding the traceframe-info
    object being built.  */
index e74458abbf70891c3614082205bb5b8708707965..b2e410f1df8201bac83132721106469d2eade139 100644 (file)
@@ -87,10 +87,6 @@ int fetch_traceframe_registers (int tfnum,
                                struct regcache *regcache,
                                int regnum);
 
-int traceframe_read_sdata (int tfnum, ULONGEST offset,
-                          unsigned char *buf, ULONGEST length,
-                          ULONGEST *nbytes);
-
 int traceframe_read_info (int tfnum, std::string *buffer);
 
 /* If a thread is determined to be collecting a fast tracepoint, this