aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli-out.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2016-12-01 15:59:01 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2016-12-01 15:59:03 -0500
commitc5209615263fd0444da28cdfb6661ad287909a70 (patch)
tree953526cb2bd235560908c252c52b3e776bf4cddf /gdb/cli-out.c
parent78afa7f8599e46eb94a93510b383dfb35e549f7e (diff)
downloadgdb-c5209615263fd0444da28cdfb6661ad287909a70.zip
gdb-c5209615263fd0444da28cdfb6661ad287909a70.tar.gz
gdb-c5209615263fd0444da28cdfb6661ad287909a70.tar.bz2
Use std::string for ui_out_hdr's text fields
This patch makes ui_out_hdr use std::string for its text fields. It makes freeing automatic when the object is deleted. gdb/ChangeLog: * mi/mi-out.c (mi_table_header): Change char * args to std::string. * cli-out.c (cli_table_header): Likewise. * ui-out.h (table_header_ftype): Likewise. (ui_out_table_header): Constify colhdr argument. (ui_out_query_field): Constify col_name argument. * ui-out.c (ui_out_hdr) <col_name, colhdr>: Change type to std::string. (uo_table_header): Change char * args to std::string. (ui_out_table_header): Likewise. (get_next_header): Constify colhdr argument and adapt. (clear_header_list): Don't free col_name/colhdr fields. (append_header_to_list): Change char * args to std::string and adapt. (verify_field): Constify variable. (ui_out_query_field): Constify col_name argument and adapt. * breakpoint.c (wrap_indent_at_field): Constify variable.
Diffstat (limited to 'gdb/cli-out.c')
-rw-r--r--gdb/cli-out.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 093b6e7..4747f40 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -94,8 +94,7 @@ cli_table_end (struct ui_out *uiout)
static void
cli_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
- const char *col_name,
- const char *colhdr)
+ const std::string &col_name, const std::string &col_hdr)
{
cli_out_data *data = (cli_out_data *) ui_out_data (uiout);
@@ -104,7 +103,7 @@ cli_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
/* Always go through the function pointer (virtual function call).
We may have been extended. */
- uo_field_string (uiout, 0, width, alignment, 0, colhdr);
+ uo_field_string (uiout, 0, width, alignment, 0, col_hdr.c_str ());
}
/* Mark beginning of a list */