From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15655 invoked by alias); 26 Sep 2013 19:57:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 15645 invoked by uid 89); 26 Sep 2013 19:57:19 -0000 Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.222.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Sep 2013 19:57:19 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.3 required=5.0 tests=AWL,BAYES_50,MSGID_MULTIPLE_AT,SPAM_SUBJECT autolearn=no version=3.3.2 X-HELO: mailhost.u-strasbg.fr Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antispam (Postfix) with ESMTP id 8317C14076D for ; Thu, 26 Sep 2013 21:56:52 +0200 (CEST) Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 73C8D1408DE for ; Thu, 26 Sep 2013 21:56:52 +0200 (CEST) Received: from md14.u-strasbg.fr (md14.u-strasbg.fr [130.79.200.249]) by mr2.u-strasbg.fr (Postfix) with ESMTP id 6350B14076D for ; Thu, 26 Sep 2013 21:56:51 +0200 (CEST) Received: from ms17.u-strasbg.fr (ms17.u-strasbg.fr [130.79.204.117]) by md14.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id r8QJup65029882 for ; Thu, 26 Sep 2013 21:56:51 +0200 Received: from E6510Muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (Authenticated sender: mullerp) by ms17.u-strasbg.fr (Postfix) with ESMTPSA id 038021FD95 for ; Thu, 26 Sep 2013 21:56:50 +0200 (CEST) From: "Pierre Muller" To: "'gdb-patches'" References: <002901cebaf2$35ec65a0$a1c530e0$@muller@ics-cnrs.unistra.fr> In-Reply-To: <002901cebaf2$35ec65a0$a1c530e0$@muller@ics-cnrs.unistra.fr> Subject: [RFC 1/6] Fix display of tabulation character for mingw hosts. Date: Thu, 26 Sep 2013 19:57:00 -0000 Message-ID: <002c01cebaf2$89798ea0$9c6cabe0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-09/txt/msg00937.txt.bz2 Tabulation characters are sent out to stdout as real tabs inside mingw compiled GDB. This is due to the fact that, contrery to other systems, msvcrt DLL version of iswprint function returns 1 for tab character. This patch solves the issue by implementing a mingw-hdep specific gdb_iswprint version, which returns 0 for tab char. Another possiblity would have been to change the implementation of print_wchar to handle LCST('\t') before calling gdb_isprint. Pierre Muller GDB pascal language maintainer 2013-09-26 Pierre Muller Fix display of tabulation character for mingw hosts. * gdb_wchar.h (gdb_iswprint): Declare as external function if __MINGW32__ macro is set. * mingw-hdep.c (gdb_iswprint): New function. >From a06acf167fde7fb8502028f83cdfaf64fc2c307b Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Thu, 26 Sep 2013 16:20:38 +0200 --- gdb/gdb_wchar.h | 4 ++++ gdb/mingw-hdep.c | 9 +++++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/gdb/gdb_wchar.h b/gdb/gdb_wchar.h index 0e785e8..2d85b5e 100644 --- a/gdb/gdb_wchar.h +++ b/gdb/gdb_wchar.h @@ -65,7 +65,11 @@ typedef wchar_t gdb_wchar_t; typedef wint_t gdb_wint_t; #define gdb_wcslen wcslen +#ifdef __MINGW32__ +extern int gdb_iswprint (gdb_wint_t); +#else #define gdb_iswprint iswprint +#endif #define gdb_iswdigit iswdigit #define gdb_btowc btowc #define gdb_WEOF WEOF diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c index efc9848..976e9e8 100644 --- a/gdb/mingw-hdep.c +++ b/gdb/mingw-hdep.c @@ -80,6 +80,15 @@ safe_strerror (int errnum) return buffer; } +/* Mingw specific version of iswprint to correct + 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); +} /* Return an absolute file name of the running GDB, if possible, or ARGV0 if not. The return value is in malloc'ed storage. */ -- 1.7.9