From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30038 invoked by alias); 17 Aug 2009 13:09:02 -0000 Received: (qmail 30030 invoked by uid 22791); 17 Aug 2009 13:09:02 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Aug 2009 13:08:53 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.14.3/8.13.8) with ESMTP id n7HD8fG6398538 for ; Mon, 17 Aug 2009 13:08:41 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n7HD8fMo2765050 for ; Mon, 17 Aug 2009 15:08:41 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n7HD8eCG023564 for ; Mon, 17 Aug 2009 15:08:40 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n7HD8dwb023540; Mon, 17 Aug 2009 15:08:39 +0200 Message-Id: <200908171308.n7HD8dwb023540@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 17 Aug 2009 15:08:39 +0200 Subject: Re: [RFA] Fix crash of convenience vars with typedefs. To: dje@google.com (Doug Evans) Date: Mon, 17 Aug 2009 13:11:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20090815000443.B0B0D8469B@localhost> from "Doug Evans" at Aug 14, 2009 05:04:43 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00232.txt.bz2 Doug Evans wrote: > gdb/value.c:1094: internal-error: bad type > A problem internal to GDB has been detected, > further debugging may prove unreliable. Oops, sorry for the breakage. > + struct type *real_type = check_typedef (var->u.scalar.type); > + switch (TYPE_CODE (check_typedef (real_type))) That's a duplicate check_typedef ... > + case TYPE_CODE_INT: > + val = value_from_longest (real_type, var->u.scalar.val.l); > + break; > + case TYPE_CODE_PTR: > + val = value_from_pointer (real_type, var->u.scalar.val.a); > + break; Shouldn't the result of value_of_internalvar still have the original typedef name instead of the type it resolves to? I'm wondering about the other places where the type is used, in particular get_internalvar_integer. Also, it seems better to avoid calling check_typedef every time ... Maybe it would be best to split the INTERNALVAR_SCALAR state into two distinct states INTERNALVAL_INTEGER and INTERNAL_POINTER; the decision can be make in set_internalvar, where we already call check_typedef, and then used subsequentially. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com