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] Fix multiple-symbols=ask regression [Re: [patchv2 7/11] Mechanical symtab->filename -> symtab_to_filename]


> > Also, this is really a nitpick but the length
> > of the lines in your comments is a little too long, and I don't see
> > a real reason to exceed our soft limit in those cases (70 characters).
> 
> So far I was aware of 72 columns but I cannot find it GDB Coding Standards nor
> in GNU Coding Standards, even the GNU Indent commandline does not reformat
> comments to any column.  Does Emacs format it to 70/72 columns or where this
> rule came from?

I've documented it in my coding-standard cheat sheet:
http://sourceware.org/gdb/wiki/JoelsCodingStyleCheatSheet#Maximum_line_length

This was discussed on gdb-patches at some point, the reference
to the discussion is provided in the Wiki.
http://www.sourceware.org/ml/gdb-patches/2011-01/msg00035.html

> While one could make a new GDB COding Standards note TBH I am not much
> fond in this rule as VIM (and I guess also other editors) cannot
> format code to a different width (80) than comments (72) so emulating
> the exact behavior of Emacs by hand even in this case is really
> inconvenient for new contributors.

It's the same for both code and comments. But 72 is acceptable
as far as I am concerned. 70 is really a soft limit, and if it allows
the code to look nicer, we should feel free to exceed it whenver
it makes sense.

> [0] cancel
> [1] all
> [2] /home/jkratoch/t/overload.C:f()
> [3] /home/jkratoch/t/overload.C:f(int)
> > 2 2
> duplicate request for 0 ignored.
> 
> NULL is there to detected the second "2" entry.

Ah, ok! Thanks for explaining.

> gdb/
> 2013-03-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* linespec.c (struct linespec_canonical_name): New.
> 	(struct linespec_state): Change canonical_names type to it.
> 	(add_sal_to_sals): Change variable canonical_name to canonical.  Change
> 	xrealloc element size.  Initialize the different CANONICAL fields.
> 	(canonical_to_fullform): New.
> 	(filter_results): Use it.  Add variables canonical, fullform and
> 	cleanup.
> 	(struct decode_line_2_item, decode_line_2_compare_items): New.
> 	(decode_line_2): Remove variables iter and item_names, add variables
> 	items and items_count.  Modify the code for these new variables.
> 
> gdb/testsuite/
> 2013-03-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* gdb.linespec/base/one/thefile.cc (twodup): New.
> 	(m): Call it.
> 	* gdb.linespec/base/two/thefile.cc (dupname): New.
> 	(n): Call it.
> 	* gdb.linespec/break-ask.exp: New file.
> 	* gdb.linespec/lspec.cc (body_elsewhere): New comment marker.

Aside from the long lines in some of the comments, which is a bit
of a nitpick, the patch looks good to me too.

Thanks!

-- 
Joel


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