From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28281 invoked by alias); 2 Apr 2006 13:49:58 -0000 Received: (qmail 28271 invoked by uid 22791); 2 Apr 2006 13:49:58 -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; Sun, 02 Apr 2006 13:49:56 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k32Dnjuh028403; Sun, 2 Apr 2006 15:49:45 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id k32DnirL020653; Sun, 2 Apr 2006 15:49:44 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id k32Dni9q004148; Sun, 2 Apr 2006 15:49:44 +0200 (CEST) Date: Sun, 02 Apr 2006 13:49:00 -0000 Message-Id: <200604021349.k32Dni9q004148@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: der.herr@hofr.at CC: mark.kettenis@xs4all.nl, der.herr@hofr.at, gdb@sourceware.org In-reply-to: <200604031349.k33DnEk24211@hofr.at> (message from Der Herr Hofrat on Mon, 3 Apr 2006 15:49:14 +0200 (CEST)) Subject: Re: /gdb/regcache.c question References: <200604031349.k33DnEk24211@hofr.at> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00006.txt.bz2 > From: Der Herr Hofrat > Date: Mon, 3 Apr 2006 15:49:14 +0200 (CEST) > > > > gdb/regcache.c:159-165 > > > struct type * > > > register_type (struct gdbarch *gdbarch, int regnum) > > > { > > > struct regcache_descr *descr = regcache_descr (gdbarch); > > > gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers); > > > return descr->register_type[regnum]; > > > } > > > > > > > > > So a simple misstyp of the register name runs into an assertion > > > with a core file dumped - this makes sense for automatic generation > > > - but for tracepoints you need to manually be able to pass > > > registers with collect $REGNAME , and for that case gdb_assert -> > > > corfile is a little harsh on the user. > > > > I don't understand what you're doing here, but that gdb_assert (and > > all gdb_asserts in the code) is checking for a "should not happen" > > condition. If you hit one, it means there's a bug in some other piece > > of gdb code. You should find and fix that bug. > > > the bug is a simple typo in a collect command - if you type in > $pc on x86 it will give you the above assertion if you use any > actually defined registers all is fine (and data is collected) > My assumption is that the assertion was put in there to catch > incorrect register names that are generated automatically, but > not interactively. No, the bug is that the code that parses your collect command is asking for the type of a register number that doesn't exist. That typo should have been caught much earlier before register_type() was called. Mark