Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andre Oliveira Loureiro do Baixo <andreolb@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] PR exp/9103
Date: Wed, 11 Mar 2009 15:37:00 -0000	[thread overview]
Message-ID: <c3f94bcc0903110825n6e6b75e4j8c03f7f1a940b06c@mail.gmail.com> (raw)
In-Reply-To: <c3f94bcc0903101928g3d767b7ah60ac81e8b6f77de@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

There is a bug filled in about GDB not printing (wchar_t *) strings in:

http://sourceware.org/bugzilla/show_bug.cgi?id=9103

This patch solves this bug.

Regards,

André Oliveira Loureiro do Baixo

[-- Attachment #2: wchart-print.patch --]
[-- Type: text/x-diff, Size: 1118 bytes --]

2009-03-10  Andre Oliveira Loureiro do Baixo  <andreolb@gmail.com>

	* c-valprint.c (c_val_print): Added support
	for printing (wchar_t *) strings.

Index: gdb/gdb/c-valprint.c
===================================================================
--- gdb.orig/gdb/c-valprint.c	2009-03-10 17:08:57.000000000 -0300
+++ gdb/gdb/c-valprint.c	2009-03-10 17:38:09.000000000 -0300
@@ -226,11 +226,12 @@
 	  if (options->addressprint)
 	    fputs_filtered (paddress (addr), stream);
 
-	  /* For a pointer to a textual type, also print the string
-	     pointed to, unless pointer is null.  */
-	  /* FIXME: need to handle wchar_t here... */
+	  /* For a pointer to a textual type (including wchar_t),
+	     also print the string pointed to, unless pointer is null.  */
 
-	  if (textual_element_type (elttype, options->format)
+	  if ((textual_element_type (elttype, options->format)
+	       || (type->main_type->target_type->main_type->name
+		   && !(strcmp ((type->main_type->target_type->main_type->name), "wchar_t"))))
 	      && addr != 0)
 	    {
 	      i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream,

       reply	other threads:[~2009-03-11 15:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c3f94bcc0903101928g3d767b7ah60ac81e8b6f77de@mail.gmail.com>
2009-03-11 15:37 ` Andre Oliveira Loureiro do Baixo [this message]
2009-03-11 16:30   ` Daniel Jacobowitz
2009-03-11 17:09     ` Andre Oliveira Loureiro do Baixo
2009-03-11 17:13       ` Tom Tromey
2009-03-11 18:37         ` Andre Oliveira Loureiro do Baixo
2009-03-11 20:29           ` Thiago Jung Bauermann
2009-03-11 22:25             ` Tom Tromey
2009-03-12  1:11               ` Tom Tromey
2009-03-13 23:37                 ` Joel Brobecker
2009-03-13 23:38                   ` Joel Brobecker
2009-03-14  1:41                     ` Tom Tromey
2009-03-14  0:10                   ` Mark Kettenis
2009-03-17 20:06                     ` Tom Tromey
2009-03-17 22:12                       ` Eli Zaretskii
2009-03-18  3:07                         ` Tom Tromey
2009-03-18  4:20                           ` Eli Zaretskii
2009-03-18 17:11                             ` Tom Tromey
2009-03-18 20:30                               ` Eli Zaretskii
2009-03-18  0:46                       ` Joel Brobecker
2009-03-18  1:14                         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c3f94bcc0903110825n6e6b75e4j8c03f7f1a940b06c@mail.gmail.com \
    --to=andreolb@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox