From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4720 invoked by alias); 18 Apr 2002 02:02:45 -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 4673 invoked from network); 18 Apr 2002 02:02:40 -0000 Received: from unknown (HELO executor.cambridge.redhat.com) (195.224.55.237) by sources.redhat.com with SMTP; 18 Apr 2002 02:02:40 -0000 Received: from prospero.cambridge.redhat.com (dell-paw-2.cambridge.redhat.com [195.224.55.226]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 6C800ABAF8; Thu, 18 Apr 2002 03:02:40 +0100 (BST) Received: by prospero.cambridge.redhat.com (Postfix, from userid 4046) id 9DFEFF7B7A; Thu, 18 Apr 2002 03:02:37 +0100 (BST) To: gdb-patches@sources.redhat.com Cc: Jason Merrill Subject: PATCH to gnuv3_rtti_type From: Jason Merrill Date: Wed, 17 Apr 2002 19:02:00 -0000 Message-ID: User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2002-04/txt/msg00579.txt.bz2 --=-=-= Content-length: 544 gnuv3_rtti_type still gets confused sometimes, by constructor vtables and namespaces at least. This wouldn't be a big problem, as mostly I don't care what the real type is, except that it gives an error and aborts. If I'm just trying to print the contents of a pointer, this is rather annoying. This patch changes the errors to warnings, so that I get the normal output which is all I really care about. OK? 2002-04-14 Jason Merrill * gnu-v3-abi.c (gnuv3_rtti_type): If we get confused, just warn and return NULL. --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-length: 2470 *** gnu-v3-abi.c.~1~ Sun Mar 17 17:10:01 2002 --- gnu-v3-abi.c Sun Apr 14 22:59:39 2002 *************** gnuv3_rtti_type (struct value *value, *** 241,262 **** vtable_symbol_name = SYMBOL_DEMANGLED_NAME (vtable_symbol); if (vtable_symbol_name == NULL || strncmp (vtable_symbol_name, "vtable for ", 11)) ! error ("can't find linker symbol for virtual table for `%s' value", ! TYPE_NAME (value_type)); class_name = vtable_symbol_name + 11; /* Try to look up the class name as a type name. */ class_symbol = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0, 0); if (! class_symbol) ! error ("can't find class named `%s', as given by C++ RTTI", class_name); /* Make sure the type symbol is sane. (An earlier version of this code would find constructor functions, who have the same name as the class.) */ if (SYMBOL_CLASS (class_symbol) != LOC_TYPEDEF || TYPE_CODE (SYMBOL_TYPE (class_symbol)) != TYPE_CODE_CLASS) ! error ("C++ RTTI gives a class name of `%s', but that isn't a type name", ! class_name); /* This is the object's run-time type! */ run_time_type = SYMBOL_TYPE (class_symbol); --- 241,273 ---- vtable_symbol_name = SYMBOL_DEMANGLED_NAME (vtable_symbol); if (vtable_symbol_name == NULL || strncmp (vtable_symbol_name, "vtable for ", 11)) ! { ! warning ("can't find linker symbol for virtual table for `%s' value", ! TYPE_NAME (value_type)); ! if (vtable_symbol_name) ! warning (" found `%s' instead", vtable_symbol_name); ! return NULL; ! } class_name = vtable_symbol_name + 11; /* Try to look up the class name as a type name. */ class_symbol = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0, 0); if (! class_symbol) ! { ! warning ("can't find class named `%s', as given by C++ RTTI", class_name); ! return NULL; ! } /* Make sure the type symbol is sane. (An earlier version of this code would find constructor functions, who have the same name as the class.) */ if (SYMBOL_CLASS (class_symbol) != LOC_TYPEDEF || TYPE_CODE (SYMBOL_TYPE (class_symbol)) != TYPE_CODE_CLASS) ! { ! warning ("C++ RTTI gives a class name of `%s', but that isn't a type name", ! class_name); ! return NULL; ! } /* This is the object's run-time type! */ run_time_type = SYMBOL_TYPE (class_symbol); --=-=-=--