public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Use std::vector in uploaded_tp
@ 2018-03-21 21:25 Simon Marchi
  2018-03-21 21:25 ` [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args Simon Marchi
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Simon Marchi @ 2018-03-21 21:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

This patch changes the VEC(char_ptr) fields in uploaded_tp to use
std::vector<char *>.  At first, I wanted to creep in more changes, like
using std::string, but it was making the patch too big and less focused,
so I decided to keep it to just that.

It also looks like the strings in those vectors are never free'd.  If
so, we can fix that in another patch.

gdb/ChangeLog:

	* tracepoint.h (struct uploaded_tp): Initialize fields.
	<actions, step_actions, cmd_strings>: Change type to
	std::vector<char *>.
	* tracepoint.c (get_uploaded_tp): Allocate with new.
	(free_uploaded_tps): Free with delete.
	(parse_tracepoint_definition): Adjust to std::vector change.
	* breakpoint.c (read_uploaded_action): Likewise.
	(create_tracepoint_from_upload): Likewise.
	* ctf.c (ctf_write_uploaded_tp): Likewise.
	(SET_ARRAY_FIELD): Likewise.
	* tracefile-tfile.c (tfile_write_uploaded_tp): Likewise.
---
 gdb/breakpoint.c      | 16 +++++++++-------
 gdb/ctf.c             | 18 ++++++++----------
 gdb/tracefile-tfile.c |  8 +++-----
 gdb/tracepoint.c      | 13 +++++--------
 gdb/tracepoint.h      | 32 ++++++++++++++++----------------
 5 files changed, 41 insertions(+), 46 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 85f2fd8..ca6d6f6 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -14754,11 +14754,13 @@ static int next_cmd;
 static char *
 read_uploaded_action (void)
 {
-  char *rslt;
+  char *rslt = nullptr;
 
-  VEC_iterate (char_ptr, this_utp->cmd_strings, next_cmd, rslt);
-
-  next_cmd++;
+  if (next_cmd < this_utp->cmd_strings.size ())
+    {
+      rslt = this_utp->cmd_strings[next_cmd];
+      next_cmd++;
+    }
 
   return rslt;
 }
@@ -14830,7 +14832,7 @@ create_tracepoint_from_upload (struct uploaded_tp *utp)
      special-purpose "reader" function and call the usual command line
      reader, then pass the result to the breakpoint command-setting
      function.  */
-  if (!VEC_empty (char_ptr, utp->cmd_strings))
+  if (!utp->cmd_strings.empty ())
     {
       command_line_up cmd_list;
 
@@ -14841,8 +14843,8 @@ create_tracepoint_from_upload (struct uploaded_tp *utp)
 
       breakpoint_set_commands (tp, std::move (cmd_list));
     }
-  else if (!VEC_empty (char_ptr, utp->actions)
-	   || !VEC_empty (char_ptr, utp->step_actions))
+  else if (!utp->actions.empty ()
+	   || !utp->step_actions.empty ())
     warning (_("Uploaded tracepoint %d actions "
 	       "have no source form, ignoring them"),
 	     utp->number);
diff --git a/gdb/ctf.c b/gdb/ctf.c
index d589ed3..07ae93b 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -530,8 +530,6 @@ ctf_write_uploaded_tp (struct trace_file_writer *self,
   int64_t int64;
   uint32_t u32;
   const gdb_byte zero = 0;
-  int a;
-  char *act;
 
   /* Event Id.  */
   int32 = CTF_EVENT_ID_TP_DEF;
@@ -569,15 +567,15 @@ ctf_write_uploaded_tp (struct trace_file_writer *self,
   ctf_save_write (&writer->tcs, &zero, 1);
 
   /* actions */
-  u32 = VEC_length (char_ptr, tp->actions);
+  u32 = tp->actions.size ();
   ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
-  for (a = 0; VEC_iterate (char_ptr, tp->actions, a, act); ++a)
+  for (char *act : tp->actions)
     ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
 
   /* step_actions */
-  u32 = VEC_length (char_ptr, tp->step_actions);
+  u32 = tp->step_actions.size ();
   ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
-  for (a = 0; VEC_iterate (char_ptr, tp->step_actions, a, act); ++a)
+  for (char *act : tp->step_actions)
     ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
 
   /* at_string */
@@ -593,9 +591,9 @@ ctf_write_uploaded_tp (struct trace_file_writer *self,
   ctf_save_write (&writer->tcs, &zero, 1);
 
   /* cmd_strings */
-  u32 = VEC_length (char_ptr, tp->cmd_strings);
+  u32 = tp->cmd_strings.size ();
   ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
-  for (a = 0; VEC_iterate (char_ptr, tp->cmd_strings, a, act); ++a)
+  for (char *act : tp->cmd_strings)
     ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
 
 }
@@ -992,8 +990,8 @@ ctf_read_tsv (struct uploaded_tsv **uploaded_tsvs)
 	  const struct bt_definition *element				\
 	    = bt_ctf_get_index ((EVENT), def, i);			\
 									\
-	  VEC_safe_push (char_ptr, (VAR)->ARRAY,			\
-			 xstrdup (bt_ctf_get_string (element)));	\
+	  (VAR)->ARRAY.push_back					\
+	    (xstrdup (bt_ctf_get_string (element)));			\
 	}								\
     }									\
   while (0)
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 4f0dc59..d7e9347 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -221,8 +221,6 @@ tfile_write_uploaded_tp (struct trace_file_writer *self,
 {
   struct tfile_trace_file_writer *writer
     = (struct tfile_trace_file_writer *) self;
-  int a;
-  char *act;
   char buf[MAX_TRACE_UPLOAD];
 
   fprintf (writer->fp, "tp T%x:%s:%c:%x:%x",
@@ -235,10 +233,10 @@ tfile_write_uploaded_tp (struct trace_file_writer *self,
 	     ":X%x,%s", (unsigned int) strlen (utp->cond) / 2,
 	     utp->cond);
   fprintf (writer->fp, "\n");
-  for (a = 0; VEC_iterate (char_ptr, utp->actions, a, act); ++a)
+  for (char *act : utp->actions)
     fprintf (writer->fp, "tp A%x:%s:%s\n",
 	     utp->number, phex_nz (utp->addr, sizeof (utp->addr)), act);
-  for (a = 0; VEC_iterate (char_ptr, utp->step_actions, a, act); ++a)
+  for (char *act : utp->step_actions)
     fprintf (writer->fp, "tp S%x:%s:%s\n",
 	     utp->number, phex_nz (utp->addr, sizeof (utp->addr)), act);
   if (utp->at_string)
@@ -254,7 +252,7 @@ tfile_write_uploaded_tp (struct trace_file_writer *self,
 			    buf, MAX_TRACE_UPLOAD);
       fprintf (writer->fp, "tp Z%s\n", buf);
     }
-  for (a = 0; VEC_iterate (char_ptr, utp->cmd_strings, a, act); ++a)
+  for (char *act : utp->cmd_strings)
     {
       encode_source_string (utp->number, utp->addr, "cmd", act,
 			    buf, MAX_TRACE_UPLOAD);
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 30fe206..2ebbdfc 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -3062,12 +3062,9 @@ get_uploaded_tp (int num, ULONGEST addr, struct uploaded_tp **utpp)
     if (utp->number == num && utp->addr == addr)
       return utp;
 
-  utp = XCNEW (struct uploaded_tp);
+  utp = new uploaded_tp;
   utp->number = num;
   utp->addr = addr;
-  utp->actions = NULL;
-  utp->step_actions = NULL;
-  utp->cmd_strings = NULL;
   utp->next = *utpp;
   *utpp = utp;
 
@@ -3082,7 +3079,7 @@ free_uploaded_tps (struct uploaded_tp **utpp)
   while (*utpp)
     {
       next_one = (*utpp)->next;
-      xfree (*utpp);
+      delete *utpp;
       *utpp = next_one;
     }
 }
@@ -3599,12 +3596,12 @@ parse_tracepoint_definition (const char *line, struct uploaded_tp **utpp)
   else if (piece == 'A')
     {
       utp = get_uploaded_tp (num, addr, utpp);
-      VEC_safe_push (char_ptr, utp->actions, xstrdup (p));
+      utp->actions.push_back (xstrdup (p));
     }
   else if (piece == 'S')
     {
       utp = get_uploaded_tp (num, addr, utpp);
-      VEC_safe_push (char_ptr, utp->step_actions, xstrdup (p));
+      utp->step_actions.push_back (xstrdup (p));
     }
   else if (piece == 'Z')
     {
@@ -3628,7 +3625,7 @@ parse_tracepoint_definition (const char *line, struct uploaded_tp **utpp)
       else if (startswith (srctype, "cond:"))
 	utp->cond_string = xstrdup (buf);
       else if (startswith (srctype, "cmd:"))
-	VEC_safe_push (char_ptr, utp->cmd_strings, xstrdup (buf));
+	utp->cmd_strings.push_back (xstrdup (buf));
     }
   else if (piece == 'V')
     {
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
index 9f4596e..ff2e2a4 100644
--- a/gdb/tracepoint.h
+++ b/gdb/tracepoint.h
@@ -165,38 +165,38 @@ extern const char *stop_reason_names[];
 
 struct uploaded_tp
 {
-  int number;
-  enum bptype type;
-  ULONGEST addr;
-  int enabled;
-  int step;
-  int pass;
-  int orig_size;
+  int number = 0;
+  enum bptype type = bp_none;
+  ULONGEST addr = 0;
+  int enabled = 0;
+  int step = 0;
+  int pass = 0;
+  int orig_size = 0;
 
   /* String that is the encoded form of the tracepoint's condition.  */
-  char *cond;
+  char *cond = nullptr;
 
   /* Vectors of strings that are the encoded forms of a tracepoint's
      actions.  */
-  VEC(char_ptr) *actions;
-  VEC(char_ptr) *step_actions;
+  std::vector<char *> actions;
+  std::vector<char *> step_actions;
 
   /* The original string defining the location of the tracepoint.  */
-  char *at_string;
+  char *at_string = nullptr;
 
   /* The original string defining the tracepoint's condition.  */
-  char *cond_string;
+  char *cond_string = nullptr;
 
   /* List of original strings defining the tracepoint's actions.  */
-  VEC(char_ptr) *cmd_strings;
+  std::vector<char *> cmd_strings;
 
   /* The tracepoint's current hit count.  */
-  int hit_count;
+  int hit_count = 0;
 
   /* The tracepoint's current traceframe usage.  */
-  ULONGEST traceframe_usage;
+  ULONGEST traceframe_usage = 0;
 
-  struct uploaded_tp *next;
+  struct uploaded_tp *next = nullptr;
 };
 
 /* Struct recording info about trace state variables on the target.  */
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args
  2018-03-21 21:25 [PATCH 1/3] Use std::vector in uploaded_tp Simon Marchi
@ 2018-03-21 21:25 ` Simon Marchi
  2018-04-01 16:29   ` Tom Tromey
  2018-03-21 21:25 ` [PATCH 2/3] Use std::vector and std::string instead of VEC(char_ptr) in gdbserver tdesc Simon Marchi
  2018-03-30 21:20 ` [PATCH 1/3] Use std::vector in uploaded_tp Simon Marchi
  2 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2018-03-21 21:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

This is a straightforward replacement, no change in behavior are
intended/expected.

This is the last usage of VEC(char_ptr), so it can now be removed.

gdb/ChangeLog:

	* guile/scm-utils.c (gdbscm_parse_function_args): Replace VEC
	with std::vector.
	* common/gdb_vecs.h (DEF_VEC_P (char_ptr)): Remove.
---
 gdb/common/gdb_vecs.h |  2 --
 gdb/guile/scm-utils.c | 13 ++++---------
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/gdb/common/gdb_vecs.h b/gdb/common/gdb_vecs.h
index 7318e53..8bb7015 100644
--- a/gdb/common/gdb_vecs.h
+++ b/gdb/common/gdb_vecs.h
@@ -25,8 +25,6 @@
 typedef char *char_ptr;
 typedef const char *const_char_ptr;
 
-DEF_VEC_P (char_ptr);
-
 DEF_VEC_P (const_char_ptr);
 
 /* Split STR, a list of DELIMITER-separated fields, into a char pointer vector.
diff --git a/gdb/guile/scm-utils.c b/gdb/guile/scm-utils.c
index c31afc6..73b0dec 100644
--- a/gdb/guile/scm-utils.c
+++ b/gdb/guile/scm-utils.c
@@ -386,7 +386,7 @@ gdbscm_parse_function_args (const char *func_name,
   SCM status;
   SCM rest = SCM_EOL;
   /* Keep track of malloc'd strings.  We need to free them upon error.  */
-  VEC (char_ptr) *allocated_strings = NULL;
+  std::vector<char *> allocated_strings;
   char *ptr;
 
   have_rest = validate_arg_format (format);
@@ -419,7 +419,7 @@ gdbscm_parse_function_args (const char *func_name,
 	  if (!gdbscm_is_false (status))
 	    goto fail;
 	  if (*p == 's')
-	    VEC_safe_push (char_ptr, allocated_strings, *(char **) arg_ptr);
+	    allocated_strings.push_back (*(char **) arg_ptr);
 	}
       ++p;
       ++position;
@@ -485,10 +485,7 @@ gdbscm_parse_function_args (const char *func_name,
 	      if (!gdbscm_is_false (status))
 		goto fail;
 	      if (p[i] == 's')
-		{
-		  VEC_safe_push (char_ptr, allocated_strings,
-				 *(char **) arg_ptr);
-		}
+		allocated_strings.push_back (*(char **) arg_ptr);
 	    }
 	}
     }
@@ -516,14 +513,12 @@ gdbscm_parse_function_args (const char *func_name,
     }
 
   va_end (args);
-  VEC_free (char_ptr, allocated_strings);
   return;
 
  fail:
   va_end (args);
-  for (i = 0; VEC_iterate (char_ptr, allocated_strings, i, ptr); ++i)
+  for (char *ptr : allocated_strings)
     xfree (ptr);
-  VEC_free (char_ptr, allocated_strings);
   gdbscm_throw (status);
 }
 \f
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/3] Use std::vector and std::string instead of VEC(char_ptr) in gdbserver tdesc
  2018-03-21 21:25 [PATCH 1/3] Use std::vector in uploaded_tp Simon Marchi
  2018-03-21 21:25 ` [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args Simon Marchi
@ 2018-03-21 21:25 ` Simon Marchi
  2018-03-30 21:20 ` [PATCH 1/3] Use std::vector in uploaded_tp Simon Marchi
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Marchi @ 2018-03-21 21:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

From: Simon Marchi <simon.marchi@polymtl.ca>

This is a straightforward replacement, no change in behavior are
intended/expected.

gdb/gdbserver/ChangeLog:

	* tdesc.h (struct target_desc) <features>: Change type to
	std::vector<std::string>.
	* tdesc.c (tdesc_get_features_xml): Adjust to std::vector
	changes.
	(tdesc_create_feature): Likewise.
---
 gdb/gdbserver/tdesc.c | 7 +++----
 gdb/gdbserver/tdesc.h | 8 +-------
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/gdb/gdbserver/tdesc.c b/gdb/gdbserver/tdesc.c
index 00a5e8d..3a932e6 100644
--- a/gdb/gdbserver/tdesc.c
+++ b/gdb/gdbserver/tdesc.c
@@ -91,7 +91,7 @@ tdesc_get_features_xml (target_desc *tdesc)
 {
   /* Either .xmltarget or .features is not NULL.  */
   gdb_assert (tdesc->xmltarget != NULL
-	      || (tdesc->features != NULL
+	      || (!tdesc->features.empty ()
 		  && tdesc->arch != NULL));
 
   if (tdesc->xmltarget == NULL)
@@ -111,9 +111,8 @@ tdesc_get_features_xml (target_desc *tdesc)
 	  buffer += "</osabi>";
 	}
 
-      char *xml;
 
-      for (int i = 0; VEC_iterate (char_ptr, tdesc->features, i, xml); i++)
+      for (const std::string &xml : tdesc->features)
 	{
 	  buffer += "<xi:include href=\"";
 	  buffer += xml;
@@ -139,7 +138,7 @@ tdesc_create_feature (struct target_desc *tdesc, const char *name,
 		      const char *xml)
 {
 #ifndef IN_PROCESS_AGENT
-  VEC_safe_push (char_ptr, tdesc->features, xstrdup (xml));
+  tdesc->features.emplace_back (xml);
 #endif
   return tdesc;
 }
diff --git a/gdb/gdbserver/tdesc.h b/gdb/gdbserver/tdesc.h
index d21574c..e501257 100644
--- a/gdb/gdbserver/tdesc.h
+++ b/gdb/gdbserver/tdesc.h
@@ -54,7 +54,7 @@ struct target_desc : tdesc_feature
   const char *xmltarget = NULL;
 
   /* XML features in this target description.  */
-  VEC (char_ptr) *features = NULL;
+  std::vector<std::string> features;
 
   /* The value of <architecture> element in the XML, replying GDB.  */
   const char *arch = NULL;
@@ -76,12 +76,6 @@ public:
 
     xfree ((char *) arch);
     xfree ((char *) osabi);
-
-    char *f;
-
-    for (i = 0; VEC_iterate (char_ptr, features, i, f); i++)
-      xfree (f);
-    VEC_free (char_ptr, features);
   }
 
   bool operator== (const target_desc &other) const
-- 
2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] Use std::vector in uploaded_tp
  2018-03-21 21:25 [PATCH 1/3] Use std::vector in uploaded_tp Simon Marchi
  2018-03-21 21:25 ` [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args Simon Marchi
  2018-03-21 21:25 ` [PATCH 2/3] Use std::vector and std::string instead of VEC(char_ptr) in gdbserver tdesc Simon Marchi
@ 2018-03-30 21:20 ` Simon Marchi
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Marchi @ 2018-03-30 21:20 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 2018-03-21 05:25 PM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> This patch changes the VEC(char_ptr) fields in uploaded_tp to use
> std::vector<char *>.  At first, I wanted to creep in more changes, like
> using std::string, but it was making the patch too big and less focused,
> so I decided to keep it to just that.
> 
> It also looks like the strings in those vectors are never free'd.  If
> so, we can fix that in another patch.

I pushed this series.

Simon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args
  2018-03-21 21:25 ` [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args Simon Marchi
@ 2018-04-01 16:29   ` Tom Tromey
  2018-04-01 18:25     ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2018-04-01 16:29 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches, Simon Marchi

>>>>> "Simon" == Simon Marchi <simon.marchi@ericsson.com> writes:

Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
Simon> This is a straightforward replacement, no change in behavior are
Simon> intended/expected.

Simon> This is the last usage of VEC(char_ptr), so it can now be removed.

I think perhaps the char_ptr typedef could be removed now too.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args
  2018-04-01 16:29   ` Tom Tromey
@ 2018-04-01 18:25     ` Simon Marchi
  2018-04-02  2:23       ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2018-04-01 18:25 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi; +Cc: gdb-patches

On 2018-04-01 12:29 PM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@ericsson.com> writes:
> 
> Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
> Simon> This is a straightforward replacement, no change in behavior are
> Simon> intended/expected.
> 
> Simon> This is the last usage of VEC(char_ptr), so it can now be removed.
> 
> I think perhaps the char_ptr typedef could be removed now too.
> 
> Tom
> 

Indeed!  I pushed this:

From ec1f2d91e07522a77cbef7a438e132ff4a2a7839 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Sun, 1 Apr 2018 14:23:17 -0400
Subject: [PATCH] Remove char_ptr typedef

Now that all instances of VEC(char_ptr) are gone, we can remove the
typedef.  There is just one usage left, that is trivial to replace.

Tested by rebuilding on an enable-targets=all build.

gdb/ChangeLog:

	* common/gdb_vecs.h (char_ptr): Remove.
	* tracepoint.c (encode_actions_1): Remove usage of char_ptr.
---
 gdb/ChangeLog         | 5 +++++
 gdb/common/gdb_vecs.h | 1 -
 gdb/tracepoint.c      | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 148b1876de59..ed039e62701d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-04-01  Simon Marchi  <simon.marchi@polymtl.ca>
+
+	* common/gdb_vecs.h (char_ptr): Remove.
+	* tracepoint.c (encode_actions_1): Remove usage of char_ptr.
+
 2018-03-30  Simon Marchi  <simon.marchi@polymtl.ca>

 	* guile/scm-utils.c (gdbscm_parse_function_args): Replace VEC
diff --git a/gdb/common/gdb_vecs.h b/gdb/common/gdb_vecs.h
index 8bb70158f47e..141d05e0189a 100644
--- a/gdb/common/gdb_vecs.h
+++ b/gdb/common/gdb_vecs.h
@@ -22,7 +22,6 @@

 #include "vec.h"

-typedef char *char_ptr;
 typedef const char *const_char_ptr;

 DEF_VEC_P (const_char_ptr);
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 954d039caf78..24bb91418a01 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1382,7 +1382,7 @@ encode_actions_1 (struct command_line *action,
 		    case OP_VAR_VALUE:
 		      {
 			struct symbol *sym = exp->elts[2].symbol;
-			char_ptr name = (char_ptr) SYMBOL_NATURAL_NAME (sym);
+			const char *name = SYMBOL_NATURAL_NAME (sym);

 			collect->collect_symbol (exp->elts[2].symbol,
 						 target_gdbarch (),
-- 
2.16.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args
  2018-04-01 18:25     ` Simon Marchi
@ 2018-04-02  2:23       ` Tom Tromey
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2018-04-02  2:23 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, Simon Marchi, gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> Indeed!  I pushed this:

Thanks for doing this.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-02  2:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21 21:25 [PATCH 1/3] Use std::vector in uploaded_tp Simon Marchi
2018-03-21 21:25 ` [PATCH 3/3] Remove usage of VEC(char_ptr) in gdbscm_parse_function_args Simon Marchi
2018-04-01 16:29   ` Tom Tromey
2018-04-01 18:25     ` Simon Marchi
2018-04-02  2:23       ` Tom Tromey
2018-03-21 21:25 ` [PATCH 2/3] Use std::vector and std::string instead of VEC(char_ptr) in gdbserver tdesc Simon Marchi
2018-03-30 21:20 ` [PATCH 1/3] Use std::vector in uploaded_tp Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).