diff options
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 58 |
1 files changed, 36 insertions, 22 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index a9be450..b53b515 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4433,16 +4433,9 @@ static void print_breakpoint_location (struct breakpoint *b, do_cleanups (old_chain); } -/* Print B to gdb_stdout. */ -static void -print_one_breakpoint_location (struct breakpoint *b, - struct bp_location *loc, - int loc_number, - struct bp_location **last_loc, - int print_address_bits, - int allflag) +static const char * +bptype_string (enum bptype type) { - struct command_line *l; struct ep_type_description { enum bptype type; @@ -4476,7 +4469,27 @@ print_one_breakpoint_location (struct breakpoint *b, {bp_static_tracepoint, "static tracepoint"}, {bp_jit_event, "jit events"}, }; - + + if (((int) type >= (sizeof (bptypes) / sizeof (bptypes[0]))) + || ((int) type != bptypes[(int) type].type)) + internal_error (__FILE__, __LINE__, + _("bptypes table does not describe type #%d."), + (int) type); + + return bptypes[(int) type].description; +} + +/* Print B to gdb_stdout. */ + +static void +print_one_breakpoint_location (struct breakpoint *b, + struct bp_location *loc, + int loc_number, + struct bp_location **last_loc, + int print_address_bits, + int allflag) +{ + struct command_line *l; static char bpenables[] = "nynny"; char wrap_indent[80]; struct ui_stream *stb = ui_out_stream_new (uiout); @@ -4521,15 +4534,8 @@ print_one_breakpoint_location (struct breakpoint *b, annotate_field (1); if (part_of_multiple) ui_out_field_skip (uiout, "type"); - else - { - if (((int) b->type >= (sizeof (bptypes) / sizeof (bptypes[0]))) - || ((int) b->type != bptypes[(int) b->type].type)) - internal_error (__FILE__, __LINE__, - _("bptypes table does not describe type #%d."), - (int) b->type); - ui_out_field_string (uiout, "type", bptypes[(int) b->type].description); - } + else + ui_out_field_string (uiout, "type", bptype_string (b->type)); /* 3 */ annotate_field (2); @@ -4907,7 +4913,8 @@ breakpoint_1 (int bnum, int allflag, int (*filter) (const struct breakpoint *)) struct cleanup *bkpttbl_chain; struct value_print_options opts; int print_address_bits = 0; - + int print_type_col_width = 14; + get_user_print_options (&opts); /* Compute the number of rows in the table, as well as the @@ -4923,10 +4930,16 @@ breakpoint_1 (int bnum, int allflag, int (*filter) (const struct breakpoint *)) if (allflag || user_settable_breakpoint (b)) { - int addr_bit = breakpoint_address_bits (b); + int addr_bit, type_len; + + addr_bit = breakpoint_address_bits (b); if (addr_bit > print_address_bits) print_address_bits = addr_bit; + type_len = strlen (bptype_string (b->type)); + if (type_len > print_type_col_width) + print_type_col_width = type_len; + nr_printable_breakpoints++; } } @@ -4947,7 +4960,8 @@ breakpoint_1 (int bnum, int allflag, int (*filter) (const struct breakpoint *)) ui_out_table_header (uiout, 7, ui_left, "number", "Num"); /* 1 */ if (nr_printable_breakpoints > 0) annotate_field (1); - ui_out_table_header (uiout, 14, ui_left, "type", "Type"); /* 2 */ + ui_out_table_header (uiout, print_type_col_width, ui_left, + "type", "Type"); /* 2 */ if (nr_printable_breakpoints > 0) annotate_field (2); ui_out_table_header (uiout, 4, ui_left, "disp", "Disp"); /* 3 */ |