This is the mail archive of the
mailing list for the GDB project.
Re: [MI non-stop 04/11] Implement --thread and --frame.
>>>>> "Eli" == Eli Zaretskii <firstname.lastname@example.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.
#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.