From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14506 invoked by alias); 3 Aug 2004 14:23:51 -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 14499 invoked from network); 3 Aug 2004 14:23:50 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 3 Aug 2004 14:23:50 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i73ENoe3002118 for ; Tue, 3 Aug 2004 10:23:50 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i73ENna17010; Tue, 3 Aug 2004 10:23:49 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id D84842B9D; Tue, 3 Aug 2004 08:36:04 -0400 (EDT) Message-ID: <410F86B4.3040500@gnu.org> Date: Tue, 03 Aug 2004 14:23:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040801 MIME-Version: 1.0 To: Daniel Jacobowitz Cc: Jim Blandy , gdb-patches@sources.redhat.com Subject: Re: RFA: assert that target_fetch_registers did its job References: <20040724004433.GA15591@nevyn.them.org> In-Reply-To: <20040724004433.GA15591@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00066.txt.bz2 > On Fri, Jul 23, 2004 at 05:59:11PM -0500, Jim Blandy wrote: > >>> >>> Does anyone see anything wrong with this? Should it be an error, or a >>> warning, instead of an internal error? It seems to me that the error >>> should be furnished by the target-specific code; if >>> target_fetch_registers returns silently, it should have done its job. > > > It shouldn't be an error. internal-error makes the most sense to me; Right, it's a contract between two internal parts of gdb. >>> But thread_db_fetch_registers doesn't follow that assumption. In the >>> threaded case, given any register number, it fetches the gprs, and the >>> fprs, supplies them, and assumes its job is done. It seems to me it >>> sholud be calling register_valid_p (current_regcache, regno) to check >>> that the register's value has really been supplied, and complaining if >>> it hasn't. > > > I suggest we slay thread_db_fetch_registers. > > Once upon a time, it served a purpose. Now it is nothing but a source > of problems. We could pass opaque cookies rather than register data > through the gregset structure - the interface doesn't really support > this but at least two of the five thread-db implementations I'm aware > of would. Or we could just give up, use thread-db for nothing besides > finding new threads, and ask the LWP for its registers directly without > six or eight call frames of indirection. You're saying have GNU/Linux thread_db_fetch_regsters bypass libthread-db? The thread-db can certainly take the shortest path to the registers. However, I'm not so sure about core GDB doing the bypass - it would violate the separation of thread and lwp (what little there is). -- Looking at the internals of libthread-db, this looks like a strong motivation for introducing more explicit greg, fpreg, ... target_objects and fetching the values using that. Andrew