[MI non-stop 04/11] Implement --thread and --frame.
Eli Zaretskii
eliz@gnu.org
Sun Jun 29 19:42:00 GMT 2008
> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Sun, 29 Jun 2008 10:03:27 +0400
> Cc: gdb-patches@sources.redhat.com
>
> > char* threadStr = "--thread ";
> > int len = strlen(threadStr);
>
> This is nice bikeshed question :-) Personally, I find that what I have is
> perfectly maintainable, due to GNU Emacs having Esc-= shortcut -- which
> counts the number of characters in a region.
I think the variant with threadStr[] and sizeof - 1 is more
maintainable, especially since not everyone uses Emacs. Moreover, a
literal constant makes code a bit harder to read, since I need to
count characters after you, to be sure I understand exactly what your
code does.
Granted, it's a minor nit, but then so are our indentation and
whitespace rules.
(Btw, in stock Emacs "ESC =" counts _lines_ in region, not characters.
You probably have some customization that does this.)
More information about the Gdb-patches
mailing list