Constify unpack_varlen_hex & fix fallout
authorPedro Alves <palves@redhat.com>
Fri, 29 Sep 2017 16:15:36 +0000 (17:15 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 29 Sep 2017 16:15:36 +0000 (17:15 +0100)
I ran into non-const unpack_varlen_hex while working on something
else, and decided to just fix it first.  Ends up constifying a good
deal of remote packet parsing.

gdb/ChangeLog:
2017-09-29  Pedro Alves  <palves@redhat.com>

* common/rsp-low.c (unpack_varlen_hex): Constify.
* common/rsp-low.h (unpack_varlen_hex): Constify.
* linux-nat.c (linux_child_static_tracepoint_markers_by_strid):
Constify.
* remote.c (remote_set_permissions, read_ptid)
(remote_current_thread, remote_get_threads_with_qthreadinfo)
(remote_static_tracepoint_marker_at)
(remote_static_tracepoint_markers_by_strid)
(stop_reply_extract_thread, remote_parse_stop_reply): Constify.
* tracepoint.c (parse_trace_status, parse_tracepoint_status)
(parse_tracepoint_definition, parse_tsv_definition)
(parse_static_tracepoint_marker_definition): Constify.
* tracepoint.h (parse_static_tracepoint_marker_definition)
(parse_trace_status, parse_tracepoint_status)
(parse_tracepoint_definition, parse_tsv_definition): Constify.

gdb/gdbserver/ChangeLog:
2017-09-29  Pedro Alves  <palves@redhat.com>

* ax.c (gdb_parse_agent_expr): Constify.
* ax.h (gdb_parse_agent_expr): Constify.
* mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
Constify.
* mem-break.h (add_breakpoint_condition, add_breakpoint_commands): Constify.
* remote-utils.c (hex_or_minus_one, read_ptid): Constify.
* remote-utils.h (read_ptid): Constify.
* server.c (handle_qxfer_exec_file, handle_query, handle_v_cont)
(process_point_options, process_serial_event): Constify.
* tracepoint.c (add_tracepoint_action, cmd_qtdp, cmd_qtdpsrc)
(cmd_qtdv, cmd_qtenable_disable, cmd_qtro, cmd_qtframe, cmd_qtp)
(cmd_qtbuffer): Constify.

16 files changed:
gdb/ChangeLog
gdb/common/rsp-low.c
gdb/common/rsp-low.h
gdb/gdbserver/ChangeLog
gdb/gdbserver/ax.c
gdb/gdbserver/ax.h
gdb/gdbserver/mem-break.c
gdb/gdbserver/mem-break.h
gdb/gdbserver/remote-utils.c
gdb/gdbserver/remote-utils.h
gdb/gdbserver/server.c
gdb/gdbserver/tracepoint.c
gdb/linux-nat.c
gdb/remote.c
gdb/tracepoint.c
gdb/tracepoint.h

index dd4fb6934942da0a265fb6ea025d60c185371efe..aaa0f14d9f3fbd1c9b5292ab4fa43ec34ef5643a 100644 (file)
@@ -1,3 +1,21 @@
+2017-09-29  Pedro Alves  <palves@redhat.com>
+
+       * common/rsp-low.c (unpack_varlen_hex): Constify.
+       * common/rsp-low.h (unpack_varlen_hex): Constify.
+       * linux-nat.c (linux_child_static_tracepoint_markers_by_strid):
+       Constify.
+       * remote.c (remote_set_permissions, read_ptid)
+       (remote_current_thread, remote_get_threads_with_qthreadinfo)
+       (remote_static_tracepoint_marker_at)
+       (remote_static_tracepoint_markers_by_strid)
+       (stop_reply_extract_thread, remote_parse_stop_reply): Constify.
+       * tracepoint.c (parse_trace_status, parse_tracepoint_status)
+       (parse_tracepoint_definition, parse_tsv_definition)
+       (parse_static_tracepoint_marker_definition): Constify.
+       * tracepoint.h (parse_static_tracepoint_marker_definition)
+       (parse_trace_status, parse_tracepoint_status)
+       (parse_tracepoint_definition, parse_tsv_definition): Constify.
+
 2017-09-29  Pedro Alves  <palves@redhat.com>
 
        * remote.c (target_buf, target_buf_size): Delete.
index 4befeb1dd81a16782443475473340ad499abddd5..85987f701519b44550d73e218b349dbc36c2f792 100644 (file)
@@ -92,8 +92,8 @@ pack_hex_byte (char *pkt, int byte)
 
 /* See rsp-low.h.  */
 
-char *
-unpack_varlen_hex (char *buff, /* packet to parse */
+const char *
+unpack_varlen_hex (const char *buff,   /* packet to parse */
                   ULONGEST *result)
 {
   int nibble;
index 2b3685f0f0def77c7e8da54fe0b649fefa7fed65..99dc93f45428747ccd3d7cb815fe37aadf99ca56 100644 (file)
@@ -41,7 +41,7 @@ extern char *pack_hex_byte (char *pkt, int byte);
    in RESULT.  Reads until a non-hex digit is seen.  Returns a pointer
    to the terminating character.  */
 
-extern char *unpack_varlen_hex (char *buff, ULONGEST *result);
+extern const char *unpack_varlen_hex (const char *buff, ULONGEST *result);
 
 /* HEX is a string of characters representing hexadecimal digits.
    Convert pairs of hex digits to bytes and store sequentially into
index 0dbcae266224a23db47af8c5fc9c6d7941f90d35..6027c7f87dfeb1851e529b705d28a855616948f0 100644 (file)
@@ -1,3 +1,18 @@
+2017-09-29  Pedro Alves  <palves@redhat.com>
+
+       * ax.c (gdb_parse_agent_expr): Constify.
+       * ax.h (gdb_parse_agent_expr): Constify.
+       * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
+       Constify.
+       * mem-break.h (add_breakpoint_condition, add_breakpoint_commands): Constify.
+       * remote-utils.c (hex_or_minus_one, read_ptid): Constify.
+       * remote-utils.h (read_ptid): Constify.
+       * server.c (handle_qxfer_exec_file, handle_query, handle_v_cont)
+       (process_point_options, process_serial_event): Constify.
+       * tracepoint.c (add_tracepoint_action, cmd_qtdp, cmd_qtdpsrc)
+       (cmd_qtdv, cmd_qtenable_disable, cmd_qtro, cmd_qtframe, cmd_qtp)
+       (cmd_qtbuffer): Constify.
+
 2017-09-29  Pedro Alves  <palves@redhat.com>
 
        * proc-service.c (ps_pdread): Return PS_ERR if reading memory
index 87b935959156a90002ac4f35fb9a956a32b5964a..35ed2c69adae8a694b4752ac3dd71795e0f5198e 100644 (file)
@@ -95,9 +95,9 @@ gdb_agent_op_name (int op)
    of bytes in expression, a comma, and then the bytes.  */
 
 struct agent_expr *
-gdb_parse_agent_expr (char **actparm)
+gdb_parse_agent_expr (const char **actparm)
 {
-  char *act = *actparm;
+  const char *act = *actparm;
   ULONGEST xlen;
   struct agent_expr *aexpr;
 
index b400cb9438c5cd93d9dfc39710cd272c9ed6e81e..6f4612b1c440b38f92d1eedc326f0cd4d6547e5e 100644 (file)
@@ -55,7 +55,7 @@ struct agent_expr
 
 /* The packet form of an agent expression consists of an 'X', number
    of bytes in expression, a comma, and then the bytes.  */
-struct agent_expr *gdb_parse_agent_expr (char **actparm);
+struct agent_expr *gdb_parse_agent_expr (const char **actparm);
 
 /* Release an agent expression.  */
 void gdb_free_agent_expr (struct agent_expr *aexpr);
index 6e6926a8d4115e9ae64ba312a803476ad36659a8..d836177165feac50b78801213dd64b86c864e2bb 100644 (file)
@@ -1269,9 +1269,9 @@ add_condition_to_breakpoint (struct gdb_breakpoint *bp,
 /* Add a target-side condition CONDITION to a breakpoint.  */
 
 int
-add_breakpoint_condition (struct gdb_breakpoint *bp, char **condition)
+add_breakpoint_condition (struct gdb_breakpoint *bp, const char **condition)
 {
-  char *actparm = *condition;
+  const char *actparm = *condition;
   struct agent_expr *cond;
 
   if (condition == NULL)
@@ -1367,10 +1367,10 @@ add_commands_to_breakpoint (struct gdb_breakpoint *bp,
 /* Add a target-side command COMMAND to the breakpoint at ADDR.  */
 
 int
-add_breakpoint_commands (struct gdb_breakpoint *bp, char **command,
+add_breakpoint_commands (struct gdb_breakpoint *bp, const char **command,
                         int persist)
 {
-  char *actparm = *command;
+  const char *actparm = *command;
   struct agent_expr *cmd;
 
   if (command == NULL)
index b14d2bee3dd529f44fa6924ed70d108eff9e5fec..54f0983d2dab2c8568de0176cd792d806170c009 100644 (file)
@@ -114,14 +114,15 @@ void clear_breakpoint_conditions_and_commands (struct gdb_breakpoint *bp);
    Returns false on failure.  On success, advances CONDITION pointer
    past the condition and returns true.  */
 
-int add_breakpoint_condition (struct gdb_breakpoint *bp, char **condition);
+int add_breakpoint_condition (struct gdb_breakpoint *bp,
+                             const char **condition);
 
 /* Set target-side commands COMMANDS to the breakpoint at ADDR.
    Returns false on failure.  On success, advances COMMANDS past the
    commands and returns true.  If PERSIST, the commands should run
    even while GDB is disconnected.  */
 
-int add_breakpoint_commands (struct gdb_breakpoint *bp, char **commands,
+int add_breakpoint_commands (struct gdb_breakpoint *bp, const char **commands,
                             int persist);
 
 int any_persistent_commands (void);
index 761604683cbc21732bb1fac592112780471948fd..66e065225b1e27531490d2911b32f1da1e7ccda7 100644 (file)
@@ -533,7 +533,7 @@ write_ptid (char *buf, ptid_t ptid)
 }
 
 static ULONGEST
-hex_or_minus_one (char *buf, char **obuf)
+hex_or_minus_one (const char *buf, const char **obuf)
 {
   ULONGEST ret;
 
@@ -554,10 +554,10 @@ hex_or_minus_one (char *buf, char **obuf)
 /* Extract a PTID from BUF.  If non-null, OBUF is set to the to one
    passed the last parsed char.  Returns null_ptid on error.  */
 ptid_t
-read_ptid (char *buf, char **obuf)
+read_ptid (const char *buf, const char **obuf)
 {
-  char *p = buf;
-  char *pp;
+  const char *p = buf;
+  const char *pp;
   ULONGEST pid = 0, tid = 0;
 
   if (*p == 'p')
index b3eab3b0954523436d8b2fbc41b230c6229af1b6..b45a72577d52ad1c951a280998f667106989dcb0 100644 (file)
@@ -28,7 +28,7 @@ int gdb_connected (void);
 #define STDIO_CONNECTION_NAME "stdio"
 int remote_connection_is_stdio (void);
 
-ptid_t read_ptid (char *buf, char **obuf);
+ptid_t read_ptid (const char *buf, const char **obuf);
 char *write_ptid (char *buf, ptid_t ptid);
 
 int putpkt (char *buf);
index f3eee31052b6f55434f96975e791fc55c3caafa1..c4f1e8dde63c3d75f727ea9e5ae9825ab9241c5a 100644 (file)
@@ -1427,7 +1427,7 @@ handle_qxfer_auxv (const char *annex,
 /* Handle qXfer:exec-file:read.  */
 
 static int
-handle_qxfer_exec_file (const char *const_annex,
+handle_qxfer_exec_file (const char *annex,
                        gdb_byte *readbuf, const gdb_byte *writebuf,
                        ULONGEST offset, LONGEST len)
 {
@@ -1438,7 +1438,7 @@ handle_qxfer_exec_file (const char *const_annex,
   if (the_target->pid_to_exec_file == NULL || writebuf != NULL)
     return -2;
 
-  if (const_annex[0] == '\0')
+  if (annex[0] == '\0')
     {
       if (current_thread == NULL)
        return -1;
@@ -1447,11 +1447,7 @@ handle_qxfer_exec_file (const char *const_annex,
     }
   else
     {
-      char *annex = (char *) alloca (strlen (const_annex) + 1);
-
-      strcpy (annex, const_annex);
       annex = unpack_varlen_hex (annex, &pid);
-
       if (annex[0] != '\0')
        return -1;
     }
@@ -2535,7 +2531,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
   if (the_target->get_tib_address != NULL
       && startswith (own_buf, "qGetTIBAddr:"))
     {
-      char *annex;
+      const char *annex;
       int n;
       CORE_ADDR tlb;
       ptid_t ptid = read_ptid (own_buf + 12, &annex);
@@ -2623,7 +2619,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
   if (startswith (own_buf, "qCRC:"))
     {
       /* CRC check (compare-section).  */
-      char *comma;
+      const char *comma;
       ULONGEST base;
       int len;
       unsigned long long crc;
@@ -2732,7 +2728,7 @@ handle_pending_status (const struct thread_resume *resumption,
 static void
 handle_v_cont (char *own_buf)
 {
-  char *p, *q;
+  const char *p;
   int n = 0, i = 0;
   struct thread_resume *resume_info;
   struct thread_resume default_action { null_ptid };
@@ -2771,8 +2767,8 @@ handle_v_cont (char *own_buf)
 
       if (p[0] == 'S' || p[0] == 'C')
        {
-         int sig;
-         sig = strtol (p + 1, &q, 16);
+         char *q;
+         int sig = strtol (p + 1, &q, 16);
          if (p == q)
            goto err;
          p = q;
@@ -2809,6 +2805,7 @@ handle_v_cont (char *own_buf)
        }
       else if (p[0] == ':')
        {
+         const char *q;
          ptid_t ptid = read_ptid (p + 1, &q);
 
          if (p == q)
@@ -4009,9 +4006,9 @@ main (int argc, char *argv[])
    after the last processed option.  */
 
 static void
-process_point_options (struct gdb_breakpoint *bp, char **packet)
+process_point_options (struct gdb_breakpoint *bp, const char **packet)
 {
-  char *dataptr = *packet;
+  const char *dataptr = *packet;
   int persist;
 
   /* Check if data has the correct format.  */
@@ -4273,7 +4270,7 @@ process_serial_event (void)
        char type = own_buf[1];
        int res;
        const int insert = ch == 'Z';
-       char *p = &own_buf[3];
+       const char *p = &own_buf[3];
 
        p = unpack_varlen_hex (p, &addr);
        kind = strtol (p + 1, &dataptr, 16);
@@ -4293,7 +4290,8 @@ process_serial_event (void)
                   is telling us to drop that list and use this one
                   instead.  */
                clear_breakpoint_conditions_and_commands (bp);
-               process_point_options (bp, &dataptr);
+               const char *options = dataptr;
+               process_point_options (bp, &options);
              }
          }
        else
index 0f41ff4c42efe7318f6dc8fbf6d37f8e43380a2b..8ec8010ac8a51dfadcc687e3791c49adbac9df9c 100644 (file)
@@ -1910,9 +1910,9 @@ find_next_tracepoint_by_number (struct tracepoint *prev_tp, int num)
 /* Append another action to perform when the tracepoint triggers.  */
 
 static void
-add_tracepoint_action (struct tracepoint *tpoint, char *packet)
+add_tracepoint_action (struct tracepoint *tpoint, const char *packet)
 {
-  char *act;
+  const char *act;
 
   if (*packet == 'S')
     {
@@ -1924,7 +1924,7 @@ add_tracepoint_action (struct tracepoint *tpoint, char *packet)
 
   while (*act)
     {
-      char *act_start = act;
+      const char *act_start = act;
       struct tracepoint_action *action = NULL;
 
       switch (*act)
@@ -2485,8 +2485,7 @@ cmd_qtdp (char *own_buf)
   ULONGEST addr;
   ULONGEST count;
   struct tracepoint *tpoint;
-  char *actparm;
-  char *packet = own_buf;
+  const char *packet = own_buf;
 
   packet += strlen ("QTDP:");
 
@@ -2546,9 +2545,7 @@ cmd_qtdp (char *own_buf)
            }
          else if (*packet == 'X')
            {
-             actparm = (char *) packet;
-             tpoint->cond = gdb_parse_agent_expr (&actparm);
-             packet = actparm;
+             tpoint->cond = gdb_parse_agent_expr (&packet);
            }
          else if (*packet == '-')
            break;
@@ -2657,8 +2654,9 @@ cmd_qtdpsrc (char *own_buf)
 {
   ULONGEST num, addr, start, slen;
   struct tracepoint *tpoint;
-  char *packet = own_buf;
-  char *saved, *srctype, *src;
+  const char *packet = own_buf;
+  const char *saved;
+  char *srctype, *src;
   size_t nbytes;
   struct source_string *last, *newlast;
 
@@ -2720,7 +2718,7 @@ cmd_qtdv (char *own_buf)
   char *varname;
   size_t nbytes;
   struct trace_state_variable *tsv;
-  char *packet = own_buf;
+  const char *packet = own_buf;
 
   packet += strlen ("QTDV:");
 
@@ -2748,7 +2746,7 @@ cmd_qtdv (char *own_buf)
 static void
 cmd_qtenable_disable (char *own_buf, int enable)
 {
-  char *packet = own_buf;
+  const char *packet = own_buf;
   ULONGEST num, addr;
   struct tracepoint *tp;
 
@@ -2870,7 +2868,7 @@ cmd_qtro (char *own_buf)
 {
   ULONGEST start, end;
   struct readonly_region *roreg;
-  char *packet = own_buf;
+  const char *packet = own_buf;
 
   trace_debug ("Want to mark readonly regions");
 
@@ -3557,7 +3555,7 @@ cmd_qtframe (char *own_buf)
   ULONGEST frame, pc, lo, hi, num;
   int tfnum, tpnum;
   struct traceframe *tframe;
-  char *packet = own_buf;
+  const char *packet = own_buf;
 
   packet += strlen ("QTFrame:");
 
@@ -3712,7 +3710,7 @@ cmd_qtp (char *own_buf)
 {
   ULONGEST num, addr;
   struct tracepoint *tpoint;
-  char *packet = own_buf;
+  const char *packet = own_buf;
 
   packet += strlen ("qTP:");
 
@@ -4005,7 +4003,7 @@ cmd_qtbuffer (char *own_buf)
 {
   ULONGEST offset, num, tot;
   unsigned char *tbp;
-  char *packet = own_buf;
+  const char *packet = own_buf;
 
   packet += strlen ("qTBuffer:");
 
index cc48d7eba83f799a8e397d45acbd74b6e254e40e..0f340ee1a0d618cb2fb990186163d46c7de4b011 100644 (file)
@@ -4291,7 +4291,7 @@ linux_child_static_tracepoint_markers_by_strid (struct target_ops *self,
   int pid = ptid_get_pid (inferior_ptid);
   VEC(static_tracepoint_marker_p) *markers = NULL;
   struct static_tracepoint_marker *marker = NULL;
-  char *p = s;
+  const char *p = s;
   ptid_t ptid = ptid_build (pid, 0, 0);
 
   /* Pause all */
index a0c6f6c6d420ecbaeb87129ea34877e5bca4d173..54d810f054325e619bfd4f5528b870adb7c7913f 100644 (file)
@@ -185,7 +185,7 @@ static void show_remote_protocol_packet_cmd (struct ui_file *file,
                                             const char *value);
 
 static char *write_ptid (char *buf, const char *endbuf, ptid_t ptid);
-static ptid_t read_ptid (char *buf, char **obuf);
+static ptid_t read_ptid (const char *buf, const char **obuf);
 
 static void remote_set_permissions (struct target_ops *self);
 
@@ -592,7 +592,7 @@ remote_get_noisy_reply ()
        {
          ULONGEST ul;
          CORE_ADDR from, to, org_to;
-         char *p, *pp;
+         const char *p, *pp;
          int adjusted_size = 0;
          int relocated = 0;
 
@@ -2445,14 +2445,15 @@ write_ptid (char *buf, const char *endbuf, ptid_t ptid)
   return buf;
 }
 
-/* Extract a PTID from BUF.  If non-null, OBUF is set to the to one
-   passed the last parsed char.  Returns null_ptid on error.  */
+/* Extract a PTID from BUF.  If non-null, OBUF is set to one past the
+   last parsed char.  Returns null_ptid if no thread id is found, and
+   throws an error if the thread id has an invalid format.  */
 
 static ptid_t
-read_ptid (char *buf, char **obuf)
+read_ptid (const char *buf, const char **obuf)
 {
-  char *p = buf;
-  char *pp;
+  const char *p = buf;
+  const char *pp;
   ULONGEST pid = 0, tid = 0;
 
   if (*p == 'p')
@@ -3088,7 +3089,7 @@ remote_current_thread (ptid_t oldpid)
   getpkt (&rs->buf, &rs->buf_size, 0);
   if (rs->buf[0] == 'Q' && rs->buf[1] == 'C')
     {
-      char *obuf;
+      const char *obuf;
       ptid_t result;
 
       result = read_ptid (&rs->buf[2], &obuf);
@@ -3232,7 +3233,7 @@ remote_get_threads_with_qthreadinfo (struct target_ops *ops,
 
   if (rs->use_threadinfo_query)
     {
-      char *bufp;
+      const char *bufp;
 
       putpkt ("qfThreadInfo");
       getpkt (&rs->buf, &rs->buf_size, 0);
@@ -3482,7 +3483,7 @@ remote_static_tracepoint_marker_at (struct target_ops *self, CORE_ADDR addr,
 
   if (*p++ == 'm')
     {
-      parse_static_tracepoint_marker_definition (p, &p, marker);
+      parse_static_tracepoint_marker_definition (p, NULL, marker);
       return 1;
     }
 
@@ -3497,7 +3498,7 @@ remote_static_tracepoint_markers_by_strid (struct target_ops *self,
   VEC(static_tracepoint_marker_p) *markers = NULL;
   struct static_tracepoint_marker *marker = NULL;
   struct cleanup *old_chain;
-  char *p;
+  const char *p;
 
   /* Ask for a first packet of static tracepoint marker
      definition.  */
@@ -3790,7 +3791,7 @@ stop_reply_extract_thread (char *stop_reply)
 {
   if (stop_reply[0] == 'T' && strlen (stop_reply) > 3)
     {
-      char *p;
+      const char *p;
 
       /* Txx r:val ; r:val (...)  */
       p = &stop_reply[3];
@@ -3798,7 +3799,7 @@ stop_reply_extract_thread (char *stop_reply)
       /* Look for "register" named "thread".  */
       while (*p != '\0')
        {
-         char *p1;
+         const char *p1;
 
          p1 = strchr (p, ':');
          if (p1 == NULL)
@@ -6836,7 +6837,7 @@ remote_parse_stop_reply (char *buf, struct stop_reply *event)
 {
   struct remote_arch_state *rsa = get_remote_arch_state ();
   ULONGEST addr;
-  char *p;
+  const char *p;
   int skipregs = 0;
 
   event->ptid = null_ptid;
@@ -6860,7 +6861,7 @@ remote_parse_stop_reply (char *buf, struct stop_reply *event)
       p = &buf[3];     /* after Txx */
       while (*p)
        {
-         char *p1;
+         const char *p1;
          int fieldsize;
 
          p1 = strchr (p, ':');
@@ -6998,7 +6999,7 @@ Packet: '%s'\n"),
          else
            {
              ULONGEST pnum;
-             char *p_temp;
+             const char *p_temp;
 
              if (skipregs)
                {
@@ -7068,7 +7069,7 @@ Packet: '%s'\n"),
       break;
     case 'w':          /* Thread exited.  */
       {
-       char *p;
+       const char *p;
        ULONGEST value;
 
        event->ws.kind = TARGET_WAITKIND_THREAD_EXITED;
@@ -7082,7 +7083,7 @@ Packet: '%s'\n"),
     case 'W':          /* Target exited.  */
     case 'X':
       {
-       char *p;
+       const char *p;
        int pid;
        ULONGEST value;
 
index 30e3a3a16d10fe4f74e57d7bd20da896ebf5370c..b6e7fe5e2ea93ac01d7fb707a7aff09b050ffa0d 100644 (file)
@@ -3405,9 +3405,9 @@ merge_uploaded_trace_state_variables (struct uploaded_tsv **uploaded_tsvs)
    the remote protocol and the trace file reader.  */
 
 void
-parse_trace_status (char *line, struct trace_status *ts)
+parse_trace_status (const char *line, struct trace_status *ts)
 {
-  char *p = line, *p1, *p2, *p3, *p_temp;
+  const char *p = line, *p1, *p2, *p3, *p_temp;
   int end;
   ULONGEST val;
 
@@ -3565,7 +3565,7 @@ Status line: '%s'\n"), p, line);
 }
 
 void
-parse_tracepoint_status (char *p, struct breakpoint *bp,
+parse_tracepoint_status (const char *p, struct breakpoint *bp,
                         struct uploaded_tp *utp)
 {
   ULONGEST uval;
@@ -3588,14 +3588,15 @@ parse_tracepoint_status (char *p, struct breakpoint *bp,
    an "uploaded tracepoint".  */
 
 void
-parse_tracepoint_definition (char *line, struct uploaded_tp **utpp)
+parse_tracepoint_definition (const char *line, struct uploaded_tp **utpp)
 {
-  char *p;
+  const char *p;
   char piece;
   ULONGEST num, addr, step, pass, orig_size, xlen, start;
   int enabled, end;
   enum bptype type;
-  char *cond, *srctype, *buf;
+  const char *srctype;
+  char *cond, *buf;
   struct uploaded_tp *utp = NULL;
 
   p = line;
@@ -3703,9 +3704,10 @@ parse_tracepoint_definition (char *line, struct uploaded_tp **utpp)
    uploaded object.  */
 
 void
-parse_tsv_definition (char *line, struct uploaded_tsv **utsvp)
+parse_tsv_definition (const char *line, struct uploaded_tsv **utsvp)
 {
-  char *p, *buf;
+  const char *p;
+  char *buf;
   ULONGEST num, initval, builtin;
   int end;
   struct uploaded_tsv *utsv = NULL;
@@ -3749,10 +3751,10 @@ free_current_marker (void *arg)
    the parsed marker definition.  */
 
 void
-parse_static_tracepoint_marker_definition (char *line, char **pp,
+parse_static_tracepoint_marker_definition (const char *line, const char **pp,
                                           struct static_tracepoint_marker *marker)
 {
-  char *p, *endp;
+  const char *p, *endp;
   ULONGEST addr;
   int end;
 
index 474563e7e93357b4faae587b97213cfe42be79b5..ffa645bacb0da00bbb29e5cd3787d2c60bc0a524 100644 (file)
@@ -295,7 +295,7 @@ private:
 };
 
 extern void parse_static_tracepoint_marker_definition
-  (char *line, char **pp,
+  (const char *line, const char **pp,
    struct static_tracepoint_marker *marker);
 extern void release_static_tracepoint_marker (struct static_tracepoint_marker *);
 extern void free_current_marker (void *arg);
@@ -342,14 +342,14 @@ extern int encode_source_string (int num, ULONGEST addr,
                                 const char *srctype, const char *src,
                                 char *buf, int buf_size);
 
-extern void parse_trace_status (char *line, struct trace_status *ts);
+extern void parse_trace_status (const char *line, struct trace_status *ts);
 
-extern void parse_tracepoint_status (char *p, struct breakpoint *tp,
+extern void parse_tracepoint_status (const char *p, struct breakpoint *tp,
                                     struct uploaded_tp *utp);
 
-extern void parse_tracepoint_definition (char *line,
+extern void parse_tracepoint_definition (const char *line,
                                         struct uploaded_tp **utpp);
-extern void parse_tsv_definition (char *line, struct uploaded_tsv **utsvp);
+extern void parse_tsv_definition (const char *line, struct uploaded_tsv **utsvp);
 
 extern struct uploaded_tp *get_uploaded_tp (int num, ULONGEST addr,
                                            struct uploaded_tp **utpp);
This page took 0.047789 seconds and 4 git commands to generate.