diff options
author | Marco Barisione <mbarisione@undo.io> | 2021-05-19 13:58:41 +0100 |
---|---|---|
committer | Marco Barisione <mbarisione@undo.io> | 2021-05-19 13:58:41 +0100 |
commit | 8dd8c8d4ab262bc4e469b9914cc9b83de3b5bcfb (patch) | |
tree | cfdd37aeb050c92492e6c559fc0bbd78427f0a7e /gdb/probe.c | |
parent | 4915bfdcfb271cab6ca7534916c42e98cf22f953 (diff) | |
download | gdb-8dd8c8d4ab262bc4e469b9914cc9b83de3b5bcfb.zip gdb-8dd8c8d4ab262bc4e469b9914cc9b83de3b5bcfb.tar.gz gdb-8dd8c8d4ab262bc4e469b9914cc9b83de3b5bcfb.tar.bz2 |
gdb: Pass std::strings to ui_out::field_string () where convenient
While adding a ui_out::text () overload accepting a std::string, I
noticed that several callers of ui_out::field_string () were converting
std::string instances to char pointers even if not necessary.
gdb/ChangeLog:
* ui-out.c (ui_out::field_string): Add missing style_argument
to the overload accepting a std::string, to make it equivalent
to the char pointer version.
* ui-out.h (class ui_out): Ditto.
* break-catch-sig.c (signal_catchpoint_print_one): Do not
convert std::strings to char pointers before passing them to
ui_out::field_string ().
* break-catch-throw.c (print_one_detail_exception_catchpoint):
Ditto.
* cli/cli-setshow.c (do_show_command): Ditto.
* disasm.c (gdb_pretty_print_disassembler::pretty_print_insn):
Ditto.
* infcmd.c (print_return_value_1): Ditto.
* inferior.c (print_inferior): Ditto.
* linux-thread-db.c (info_auto_load_libthread_db): Ditto.
* mi/mi-cmd-var.c (print_varobj): Ditto.
(mi_cmd_var_set_format): Ditto.
(mi_cmd_var_info_type): Ditto.
(mi_cmd_var_info_expression): Ditto.
(mi_cmd_var_evaluate_expression): Ditto.
(mi_cmd_var_assign): Ditto.
(varobj_update_one): Ditto.
* mi/mi-main.c (list_available_thread_groups): Ditto.
(mi_cmd_data_read_memory_bytes): Ditto.
(mi_cmd_trace_frame_collected): Ditto.
* osdata.c (info_osdata): Ditto.
* probe.c (info_probes_for_spops): Ditto.
* target-connection.c (print_connection): Ditto.
* thread.c (print_thread_info_1): Ditto.
* tracepoint.c (print_one_static_tracepoint_marker): Ditto.
Diffstat (limited to 'gdb/probe.c')
-rw-r--r-- | gdb/probe.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/probe.c b/gdb/probe.c index 9eccf82..d9a06e5 100644 --- a/gdb/probe.c +++ b/gdb/probe.c @@ -571,9 +571,8 @@ info_probes_for_spops (const char *arg, int from_tty, ui_out_emit_tuple tuple_emitter (current_uiout, "probe"); current_uiout->field_string ("type", probe_type); - current_uiout->field_string ("provider", - probe.prob->get_provider ().c_str ()); - current_uiout->field_string ("name", probe.prob->get_name ().c_str ()); + current_uiout->field_string ("provider", probe.prob->get_provider ()); + current_uiout->field_string ("name", probe.prob->get_name ()); current_uiout->field_core_addr ("addr", probe.prob->get_gdbarch (), probe.prob->get_relocated_address (probe.objfile)); |