From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18108 invoked by alias); 19 Jan 2002 20:40:47 -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 18065 invoked from network); 19 Jan 2002 20:40:44 -0000 Received: from unknown (HELO bothner.com) (216.102.199.253) by sources.redhat.com with SMTP; 19 Jan 2002 20:40:44 -0000 Received: from bothner.com (eureka.bothner.com [192.168.1.9]) by bothner.com (8.11.6/8.11.6) with ESMTP id g0JKfxM19795; Sat, 19 Jan 2002 12:41:59 -0800 Message-ID: <3C49D9DF.4040700@bothner.com> Date: Sat, 19 Jan 2002 12:40:00 -0000 From: Per Bothner User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7+) Gecko/20020111 X-Accept-Language: en-us MIME-Version: 1.0 To: gdb-patches@sources.redhat.com CC: per@bothner.com Subject: patch to robustify gnuv3_rtti_type Content-Type: multipart/mixed; boundary="------------000606060305000300090900" X-SW-Source: 2002-01/txt/msg00542.txt.bz2 This is a multi-part message in MIME format. --------------000606060305000300090900 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 401 Ok to check in? This doesn't fix the real problem, which is that gcj produces vtables that aren't properly abi-compliant. Hopefully, we'll fix that. But for now, let's at least prevent gdb from crashing. * gnu-v3-abi.c (gnuv3_rtti_type): Guard that vtable_symbol_name isn't NULL, which can happen with some gcj3.0-produced code. -- --Per Bothner per@bothner.com http://www.bothner.com/per/ --------------000606060305000300090900 Content-Type: text/plain; name="rtti.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rtti.patch" Content-length: 777 Index: gnu-v3-abi.c =================================================================== RCS file: /cvs/src/src/gdb/gnu-v3-abi.c,v retrieving revision 1.6 diff -u -r1.6 gnu-v3-abi.c --- gnu-v3-abi.c 2002/01/04 18:20:19 1.6 +++ gnu-v3-abi.c 2002/01/19 20:33:49 @@ -239,7 +239,8 @@ type_info object itself to get the class name. But this way should work just as well, and doesn't read target memory. */ vtable_symbol_name = SYMBOL_DEMANGLED_NAME (vtable_symbol); - if (strncmp (vtable_symbol_name, "vtable for ", 11)) + 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; --------------000606060305000300090900--