aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-out.h
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/ui-out.h
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/ui-out.h')
-rw-r--r--gdb/ui-out.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index e251d77..ed2911d 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -74,8 +74,9 @@ extern void ui_out_end (struct ui_out *uiout, enum ui_out_type type);
field, ... }, ... ] }''. If NR_ROWS is negative then there is at
least one row. */
extern void ui_out_table_header (struct ui_out *uiout, int width,
- enum ui_align align, const char *col_name,
- const char *colhdr);
+ enum ui_align align,
+ const std::string &col_name,
+ const std::string &col_hdr);
extern void ui_out_table_body (struct ui_out *uiout);
@@ -129,7 +130,8 @@ extern void ui_out_flush (struct ui_out *uiout);
extern int ui_out_test_flags (struct ui_out *uiout, int mask);
extern int ui_out_query_field (struct ui_out *uiout, int colno,
- int *width, int *alignment, char **col_name);
+ int *width, int *alignment,
+ const char **col_name);
/* HACK: Code in GDB is currently checking to see the type of ui_out
builder when determining which output to produce. This function is
@@ -152,8 +154,9 @@ typedef void (table_begin_ftype) (struct ui_out * uiout,
typedef void (table_body_ftype) (struct ui_out * uiout);
typedef void (table_end_ftype) (struct ui_out * uiout);
typedef void (table_header_ftype) (struct ui_out * uiout, int width,
- enum ui_align align, const char *col_name,
- const char *colhdr);
+ enum ui_align align,
+ const std::string &col_name,
+ const std::string &col_hdr);
/* Note: level 0 is the top-level so LEVEL is always greater than
zero. */
typedef void (ui_out_begin_ftype) (struct ui_out *uiout,