From c50e36c288125ecd2c2249fcf4e7fd7cb6d61ef9 Mon Sep 17 00:00:00 2001 From: Peter Schauer Date: Tue, 1 Nov 1994 21:04:11 +0000 Subject: [PATCH] * c-valprint.c (c_value_print): Check for plain literal `char' target type when suppressing `(char *)' output for strings. --- gdb/ChangeLog | 5 +++++ gdb/c-valprint.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bae527f9dc1..6b10dbe47db 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 1 13:00:46 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * c-valprint.c (c_value_print): Check for plain literal `char' + target type when suppressing `(char *)' output for strings. + Mon Oct 31 19:19:51 1994 Stan Shebs (shebs@andros.cygnus.com) * coffread.c (coff_symfile_init): Remove unused local abfd. diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index ee98fc46e3f..5e5791b12aa 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -494,9 +494,9 @@ c_value_print (val, stream, format, pretty) /* Hack: remove (char *) for char strings. Their type is indicated by the quoted string anyway. */ if (TYPE_CODE (type) == TYPE_CODE_PTR && - TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof(char) && - TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_INT && - !TYPE_UNSIGNED (TYPE_TARGET_TYPE (type))) + TYPE_NAME (type) == NULL && + TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL && + STREQ (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char")) { /* Print nothing */ } -- 2.30.2