On Saturday 08 September 2007 15:46:48 Eli Zaretskii wrote: > > From: Vladimir Prus > > Date: Sat, 8 Sep 2007 02:48:52 +0400 > > > > @@ -3397,30 +3448,79 @@ print_one_breakpoint (struct breakpoint > > struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb); > > struct cleanup *bkpt_chain; > > [...] > > - ui_out_field_int (uiout, "number", b->number); > > + if (part_of_multiple) > > + { > > + char buf[30]; > > Why 30? GNU coding standards frown on arbitrary constant sizes. > > Clearly, '30' is sufficient for 2^32 breakpoints, each having 2^32 > > locations. > > Are we talking only about 32-bit machines? The address size is not important -- we only care about the *number* of breakpoints and locations. And having 2^32 breakpoints each with 2^32 locations is seriously beyond reasonable number. Anyway, to avoid further discussion, I've changed code to use asprintf. > > + sprintf (buf, "%d.%d", b->number, loc_number); > > + ui_out_field_string (uiout, "number", buf); > > I'm worried about this N.M thing: when the number of locations takes > 2 or 3 digits, won't it disrupt the display alignment? I've increased the field width from 3 to 7 -- which will tolerate 3 digits of breakpoint number, dot, and 3 digits of breakpoint location number. Clearly, this still can overflow, but we can get overflow in the current gdb, too. > > +/* set_raw_breakpoint() is a low level routine for allocating and > > Another GNU coding standards thing: foo() should not be used as an > indication that `foo' is a function. Just say `foo' instead; foo() > looks like a call to `foo' with no arguments, which is not what you > mean. Changed. I attach revised patch. Does it look OK? Thanks, Volodya