From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24831 invoked by alias); 3 Mar 2008 19:55:31 -0000 Received: (qmail 24789 invoked by uid 22791); 3 Mar 2008 19:55:30 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Mar 2008 19:55:13 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.1/8.14.1) with ESMTP id m23Jt7D9017134; Mon, 3 Mar 2008 20:55:08 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.1/8.14.1/Submit) id m23Jt7cj019540; Mon, 3 Mar 2008 20:55:07 +0100 (CET) Date: Mon, 03 Mar 2008 19:55:00 -0000 Message-Id: <200803031955.m23Jt7cj019540@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: deuling@de.ibm.com CC: gdb-patches@sourceware.org, uweigand@de.ibm.com In-reply-to: <47CC5332.3020700@de.ibm.com> (deuling@de.ibm.com) Subject: Re: [patch] Add proper error message instead of gdb_assert References: <47CC5332.3020700@de.ibm.com> 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: 2008-03/txt/msg00014.txt.bz2 > Date: Mon, 03 Mar 2008 20:36:18 +0100 > From: "Markus Deuling" > > Hi, > > when trying to put > 1 values into an array (fortran subrange) which > comes from a register, register_size is called with regnum =3D=3D -1. > > The following example comes from SPU architecture. Currently GDB exits > with a gdb_assert going wrong: > > (gdb) set $r0%v2_int64(0:1)=3D(1,2) > .../../../gdb-6.7/gdb/regcache.c:177: internal-error: register_size: = > Assertion `regnum >=3D 0 && regnum < (gdbarch_num_regs (gdbarch) + = > gdbarch_num_pseudo_regs (gdbarch))' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) y > > This patch replaces that gdb_assert by a proper error message before > exiting: > > (gdb) set $r2%v2_int64(0:1)=3D(1,1) > .../../../gdb-6.7/gdb/regcache.c:185: internal-error: invalid register -1 > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) > > If this patch is ok it would be great to have it in gdb 6.8. Ok? Sorry, but I don't see why your error message is "proper". The gdb_assert() should never fail; the fact that it does means that you have a bug elsewhere in gdb.