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: [RFC 1/6] Fix display of tabulation character for mingw hosts.


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


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