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: [MI non-stop 04/11] Implement --thread and --frame.


On Sun, 2008-06-29 at 13:41 -0600, Tom Tromey wrote:
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
> 
> Eli> I think the variant with threadStr[] and sizeof - 1 is more
> Eli> maintainable, especially since not everyone uses Emacs.  Moreover, a
> Eli> literal constant makes code a bit harder to read, since I need to
> Eli> count characters after you, to be sure I understand exactly what your
> Eli> code does.
> 
> libcpp uses:
> 
> #define DSC(str) (const unsigned char *)str, sizeof str - 1
> 
> Sometimes this is a bit obscure but it has the nice quality that you
> can use the string constant in the place where it is needed, and you
> only have to write it once.  (The 'unsigned' is because libcpp uses
> unsigned chars everywhere -- gdb wouldn't need this.)

Boy... IMHO, I find that *very* obscure.
I wouldn't like reading code that used that, 
if I had no idea what it was or where it was defined.

Granted it's also clever...




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