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;
{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);
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);
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
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++;
}
}
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 */