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: [PATCH] "enable count" user input error handling (PR gdb/15678)


On 06/26/2013 07:33 PM, Simon Marchi wrote:
> Typing "enable count" by itself crashes GDB. Also, if you omit the
> breakpoint number/range, the error message is not very clear:
> 
> (gdb) enable count 2
> warning: bad breakpoint number at or near ''
> (gdb) enable count
> Segmentation fault (core dumped)
> 
> With this patch, the error messages are slightly more helpful:
> 
> (gdb) enable count 2
> Argument required (one or more breakpoint numbers).

Most if not all enable/disable breakpoint-and-similars commands
when not passed a breakpoint number apply to all breakpoints.
Supporting that would make it possible to disable the count
for all breakpoints with just "enable count 0".

WDY(all)T of making that work?

> (gdb) enable count
> Argument required (hit count).
> 
> They are not as helpful to the user as I would like, but it's better
> than crashing. Suggestions are welcome.
> 
> Simon
> 
> gdb/ChangeLog:
> 2013-06-26  Simon Marchi  <simon.marchi@ericsson.com>
> 
> 	* breakpoint.c (map_breakpoint_numbers): Check for empty args
> 	string.
> 	(enable_count_command): Check args for NULL value.
> 
> gdb/testsuite/ChangeLog:
> 2013-06-26  Simon Marchi  <simon.marchi@ericsson.com>
> 
> 	* gdb.base/ena-dis-br.exp: Test "enable count" for bad user input.

This is OK.  Please add a line to the ChangeLog entries mentioning
the PR number.  That'll make the commit automatically be logged with
the PR (provided the ChangeLog entry is pasted in the commit log).
See existing entries for examples, or the contribution
checklist page in the wiki for a more format explanation.

Thanks!

-- 
Pedro Alves


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