This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 1/6] Fix display of tabulation character for mingw hosts.
- From: Keith Seitz <keiths at redhat dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: "'gdb-patches'" <gdb-patches at sourceware dot org>
- Date: Mon, 30 Sep 2013 18:19:07 -0700
- Subject: Re: [RFC 1/6] Fix display of tabulation character for mingw hosts.
- Authentication-results: sourceware.org; auth=none
- References: <002901cebaf2$35ec65a0$a1c530e0$ at muller@ics-cnrs.unistra.fr> <002c01cebaf2$89798ea0$9c6cabe0$ at muller@ics-cnrs.unistra.fr>
On 09/26/2013 12:56 PM, Pierre Muller wrote:
2013-09-26 Pierre Muller <muller@sourceware.org>
Fix display of tabulation character for mingw hosts.
^^^^^
Probably want to keep this a little formal and use "MinGW".
* gdb_wchar.h (gdb_iswprint): Declare as external function
if __MINGW32__ macro is set.
* mingw-hdep.c (gdb_iswprint): New function.
I think this is a reasonable approach, but it will break builds that
don't have a working/good iconv (amongst other reasons). I noticed this
attempting to build --build=i686-unknown-linux
--target=--host=i686-pc-mingw32:
../../gdb/gdb/mingw-hdep.c:88:5: error: 'isprint' redeclared without
dllimport attribute: previous dllimport ignored [-Werror=attributes]
This happens because we end up in the very last section of gdb_wchar.h
("If we got here and have wchar_t support, we might be on a system with
some problem. So, we just disable everything.") and that does:
#define gdb_iswprint isprint
> +/* Mingw specific version of iswprint to correct
"MinGW-specific"
> + difference concerning the tabulation character:
> + msvcrt dll iswprint returns 1 for '\t' while
> + UNIX uiswprint function returns 0 for '\t'. */
> +
> +int gdb_iswprint (gdb_wint_t wc)
^^^^^^^^^^^^^^^^^
> +{
> + return wc == LCST ('\t') ? 0 : iswprint (wc);
> +}
The return type should be on a line by itself and the function name
should start in column zero. Also please double-check that there is a
newline between the closing brace of safe_strerror and the comment for
this new function. [Maybe your patch got munged a bit?]
Does this fix the output of many tests in the test suite already? If
not, it would be really, really nice to have a test to check (and
demonstrate) this quirk.
Keith