From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6160 invoked by alias); 5 Dec 2004 18:48:44 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5805 invoked from network); 5 Dec 2004 18:48:27 -0000 Received: from unknown (HELO marvin.codito.net) (203.197.88.2) by sourceware.org with SMTP; 5 Dec 2004 18:48:27 -0000 Received: from [192.168.100.52] ([220.224.40.116]) (authenticated bits=0) by marvin.codito.net (8.13.1/8.13.1/Debian-17) with ESMTP id iB5J5bqb007230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 6 Dec 2004 00:36:06 +0530 Message-ID: <41B35793.5010602@codito.com> Date: Sun, 05 Dec 2004 19:12:00 -0000 From: Ramana Radhakrishnan User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com CC: cagney@gnu.org, dk@artimi.org Subject: [PATCH] Fix for PR exp/1821 Content-Type: multipart/mixed; boundary="------------010607080904070606050604" X-SW-Source: 2004-12/txt/msg00131.txt.bz2 This is a multi-part message in MIME format. --------------010607080904070606050604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 736 Hi , I was looking at PR 1821 today and realized that the problem is because cplus_print_value_fields is shared between c-valprint.c and cp-valprint.c . fprintf_symbol_filtered is called with language_cplus automatically while it should be dependent on the current language . This patch attempts to use current_language->la_language to pass to fprintf_symbol_filtered so that the correct demangler is used. Tested with i686-pc-linux-gnu using gcc 3.3.4 (Debian) and no extra regressions. Ok to commit ? cheers Ramana ChangeLog: 2004-12-06 Ramana Radhakrishnan Fix PR exp/1821 * cp-valprint.c(cp_print_value_fields): Pass current language to fprintf_symbol_filtered. --------------010607080904070606050604 Content-Type: text/plain; name="gdbpr1821patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdbpr1821patch" Content-length: 2612 Index: cp-valprint.c =================================================================== RCS file: /cvs/src/src/gdb/cp-valprint.c,v retrieving revision 1.27 diff -c -3 -p -r1.27 cp-valprint.c *** cp-valprint.c 12 Nov 2004 21:45:06 -0000 1.27 --- cp-valprint.c 5 Dec 2004 18:23:27 -0000 *************** *** 35,41 **** #include "target.h" #include "cp-abi.h" #include "valprint.h" ! int vtblprint; /* Controls printing of vtbl's */ int objectprint; /* Controls looking up an object's derived type using what we find in its vtables. */ --- 35,41 ---- #include "target.h" #include "cp-abi.h" #include "valprint.h" ! #include "language.h" int vtblprint; /* Controls printing of vtbl's */ int objectprint; /* Controls looking up an object's derived type using what we find in its vtables. */ *************** cp_print_value_fields (struct type *type *** 317,327 **** if (TYPE_FIELD_STATIC (type, i)) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), ! language_cplus, DMGL_PARAMS | DMGL_ANSI); fputs_filtered ("\" \"", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), ! language_cplus, DMGL_PARAMS | DMGL_ANSI); fputs_filtered ("\") \"", stream); } --- 317,327 ---- if (TYPE_FIELD_STATIC (type, i)) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), ! current_language->la_language, DMGL_PARAMS | DMGL_ANSI); fputs_filtered ("\" \"", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), ! current_language->la_language, DMGL_PARAMS | DMGL_ANSI); fputs_filtered ("\") \"", stream); } *************** cp_print_value_fields (struct type *type *** 332,338 **** if (TYPE_FIELD_STATIC (type, i)) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), ! language_cplus, DMGL_PARAMS | DMGL_ANSI); annotate_field_name_end (); /* do not print leading '=' in case of anonymous unions */ --- 332,338 ---- if (TYPE_FIELD_STATIC (type, i)) fputs_filtered ("static ", stream); fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), ! current_language->la_language, DMGL_PARAMS | DMGL_ANSI); annotate_field_name_end (); /* do not print leading '=' in case of anonymous unions */ --------------010607080904070606050604--