From 10f64178412d9c6e4f2faade0da271ab8be273c9 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 3 Dec 2017 12:50:43 -0500 Subject: Make make-target-delegates grok namespace scope op and template params The next patch will want to use gdb::array_view as parameter type of a target_ops method. However, that runs into a make-target-delegates limitation: target_debug_foo calls in target-delegates.c for parameters/return types with namespace scope operators ("::") or template parameters, end up looking like: @@ -1313,9 +1313,7 @@ debug_set_syscall_catchpoint (struct target_ops *self, int arg1, int arg2, int a fputs_unfiltered (", ", gdb_stdlog); target_debug_print_int (arg3); fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_int (arg4); - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_int_p (arg5); + target_debug_print_gdb::array_view (arg4); which obviously isn't something that compiles. The problem is that make-target-delegates wasn't ever taught that '::', '<', and '>' can appear in parameter/return types. You could work around it by hidding the unsupported characters behind a typedef in the target method declaration, or by using an explicit TARGET_DEBUG_PRINTER, but it's better to just remove the limitation. While at it, also fix an "abuse" of reserved identifiers. gdb/ChangeLog: * 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. --- gdb/target-debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/target-debug.h') 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)) -- cgit v1.1