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.


>>>>> "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.)

Eli> (Btw, in stock Emacs "ESC =" counts _lines_ in region, not characters.
Eli> You probably have some customization that does this.)

FWIW count-lines-region displays the number of characters as well as
the number of lines.

Tom


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