From c252925ccc8c3c2ce2a65d12a50acfee53914ce3 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 9 Apr 2018 15:16:19 -0400 Subject: Remove VEC(tsv_s), use std::vector instead This patch removes VEC(tsv_s), using an std::vector instead. I C++ified trace_state_variable a bit in the process, using std::string for the name. I also thought it would be nicer to pass a const reference to target_download_trace_state_variable, since we know it will never be NULL. This highlighted that the make-target-delegates script didn't handle references well, so I adjusted this as well. It will surely be useful in the future. gdb/ChangeLog: * tracepoint.h (struct trace_state_variable): Add constructor. : Change type to std::string. * tracepoint.c (tsv_s): Remove. (DEF_VEC_O(tsv_s)): Remove. (tvariables): Change to std::vector. (create_trace_state_variable): Adjust to std::vector. (find_trace_state_variable): Likewise. (find_trace_state_variable_by_number): Likewise. (delete_trace_state_variable): Likewise. (trace_variable_command): Adjust to std::string. (delete_trace_variable_command): Likewise. (tvariables_info_1): Adjust to std::vector. (save_trace_state_variables): Likewise. (start_tracing): Likewise. (merge_uploaded_trace_state_variables): Adjust to std::vector and std::string. * target.h (struct target_ops) : Pass reference to trace_state_variable. * target-debug.h (target_debug_print_const_trace_state_variable_r): New. * target-delegates.c: Re-generate. * mi/mi-interp.c (mi_tsv_created): Adjust to std::string. (mi_tsv_deleted): Likewise. * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise. * remote.c (remote_download_trace_state_variable): Change pointer to reference and adjust. * make-target-delegates (parse_argtypes): Handle references. (write_function_header): Likewise. (munge_type): Likewise. --- gdb/make-target-delegates | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/make-target-delegates') diff --git a/gdb/make-target-delegates b/gdb/make-target-delegates index 5f77c9d..bf91ddc 100755 --- a/gdb/make-target-delegates +++ b/gdb/make-target-delegates @@ -115,7 +115,7 @@ sub parse_argtypes($) { foreach $iter (@typelist) { if ($iter =~ m/^(enum\s+${SYMBOL}\s*)(${SYMBOL})?$/) { $onetype = $1; - } elsif ($iter =~ m/^(.*(enum\s+)?${SYMBOL}.*(\s|\*))${SYMBOL}+$/) { + } elsif ($iter =~ m/^(.*(enum\s+)?${SYMBOL}.*(\s|\*|&))${SYMBOL}+$/) { $onetype = $1; } elsif ($iter eq 'void') { next; @@ -151,7 +151,7 @@ sub write_function_header($$@) { $val =~ s/$TARGET_DEBUG_PRINTER//; - if ($iter !~ m,\*$,) { + if ($iter !~ m,(\*|&)$,) { $val .= ' '; } @@ -234,6 +234,7 @@ sub munge_type($) { ($result = $typename) =~ s/\s+$//; $result =~ s/[ ()<>:]/_/g; $result =~ s/[*]/p/g; + $result =~ s/&/r/g; # Identifers with double underscores are reserved to the C++ # implementation. -- cgit v1.1