This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [8/9] multiple locations


> From: Vladimir Prus <vladimir@codesourcery.com>
> 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.

> +      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?

> -  ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int) b->enable_state]);
> -  ui_out_spaces (uiout, 2);
> +  if (part_of_multiple)
> +    ui_out_field_string (uiout, "enabled", 
> +			 loc->shlib_disabled 
> +			 ? (loc->enabled ? "y(p)" : "n(p)")
> +			 : (loc->enabled ? "y" : "n"));

These changes in the breakpoint display should be documented in the
user manual.

> +	    else if (header_of_multiple)
> +	      ui_out_field_string (uiout, "addr", "<MULTIPLE>");

And this.

> +/* 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.

> @@ -7579,6 +7874,13 @@ disable_command (char *args, int from_tt
>        default:
>  	continue;
>        }
> +  else if (strchr (args, '.'))
> +    {
> +      struct bp_location *loc = find_location_by_number (args);
> +      if (loc)
> +	loc->enabled = 0;
> +      check_duplicates (loc->owner);
> +    }

This new feature needs documentation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]