aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog11
-rwxr-xr-xgdb/make-target-delegates12
-rw-r--r--gdb/target-debug.h2
-rw-r--r--gdb/target-delegates.c2
4 files changed, 24 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3a7b654..a360083 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2017-12-03 Pedro Alves <palves@redhat.com>
+
+ * make-target-delegates (munge_type): Also munge '<', '>', and
+ ':'. Avoid double underscores in identifiers, and trailing
+ underscores.
+ * target-debug.h
+ (target_debug_print_VEC_static_tracepoint_marker_p__p): Rename to
+ ...
+ (target_debug_print_VEC_static_tracepoint_marker_p_p): ... this.
+ * target-delegates.c: Regenerate.
+
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* common/poison.h (XDELETE): Fix typo.
diff --git a/gdb/make-target-delegates b/gdb/make-target-delegates
index fd51c64..1773232 100755
--- a/gdb/make-target-delegates
+++ b/gdb/make-target-delegates
@@ -232,8 +232,18 @@ sub munge_type($) {
$result = $1;
} else {
($result = $typename) =~ s/\s+$//;
- $result =~ s/[ ()]/_/g;
+ $result =~ s/[ ()<>:]/_/g;
$result =~ s/[*]/p/g;
+
+ # Identifers with double underscores are reserved to the C++
+ # implementation.
+ $result =~ s/_+/_/g;
+
+ # Avoid ending the function name with underscore, for
+ # cosmetics. Trailing underscores appear after munging types
+ # with template parameters, like e.g. "foo<int>".
+ $result =~ s/_$//g;
+
$result = 'target_debug_print_' . $result;
}
diff --git a/gdb/target-debug.h b/gdb/target-debug.h
index 14196b4..068495e 100644
--- a/gdb/target-debug.h
+++ b/gdb/target-debug.h
@@ -116,7 +116,7 @@
target_debug_do_print (host_address_to_string (X))
#define target_debug_print_mem_region_vector(X) \
target_debug_do_print (host_address_to_string (X.data ()))
-#define target_debug_print_VEC_static_tracepoint_marker_p__p(X) \
+#define target_debug_print_VEC_static_tracepoint_marker_p_p(X) \
target_debug_do_print (host_address_to_string (X))
#define target_debug_print_const_struct_target_desc_p(X) \
target_debug_do_print (host_address_to_string (X))
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index e0d7a9a..1cbe6f8 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -3352,7 +3352,7 @@ debug_static_tracepoint_markers_by_strid (struct target_ops *self, const char *a
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_const_char_p (arg1);
fputs_unfiltered (") = ", gdb_stdlog);
- target_debug_print_VEC_static_tracepoint_marker_p__p (result);
+ target_debug_print_VEC_static_tracepoint_marker_p_p (result);
fputs_unfiltered ("\n", gdb_stdlog);
return result;
}