From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32763 invoked by alias); 8 Jun 2004 23:38:36 -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 32718 invoked from network); 8 Jun 2004 23:38:30 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sourceware.org with SMTP; 8 Jun 2004 23:38:30 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i58NcLpu000265; Wed, 9 Jun 2004 01:38:21 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i58NcLl3000661; Wed, 9 Jun 2004 01:38:21 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i58NcL8w000658; Wed, 9 Jun 2004 01:38:21 +0200 (CEST) Date: Tue, 08 Jun 2004 23:38:00 -0000 Message-Id: <200406082338.i58NcL8w000658@elgar.kettenis.dyndns.org> From: Mark Kettenis To: nathanw@wasabisystems.com, jimb@redhat.com CC: gdb-patches@sources.redhat.com In-reply-to: (nathanw@wasabisystems.com) Subject: Re: [PATCH] Some regset-related cleanup for i386bsd-nat.c References: <200405311001.i4VA1Ok1041099@elgar.kettenis.dyndns.org> X-SW-Source: 2004-06/txt/msg00164.txt.bz2 From: "Nathan J. Williams" Date: 08 Jun 2004 16:49:15 -0400 Mark Kettenis writes: > * i386bsd-nat.c: Don't include "gregset.h". > (supply_gregset, fill_gregset): Make static. > (supply_fpregset, fill_fpregset): Remove. I just noticed this in one of my builds. I'm attempting to modernize and prepare my NetBSD thread support code for integration, and that code uses the {supply,fill}_{regset,fpregset} functions to implement the thread-specific fetch_registers and store_registers, based on register context passed back from the pthread debugging library (It was quite a boon when I ported it forward from 5.0 to 5.3 and got these functions to use). If these are removed, is there a good way for an architecture-neutral bit of code like nbsd-thread.c to go back and forth between GDB's register storage and native register storage? It's not entirely cristallized out yet, but yes there will be. The idea is to use "register sets" as fleshed out in regset.h. A register set contains a supply_regset() and collect_regset() member function that knows how to convert between a target's register sets (i.e. `struct reg' and `struct fpreg' for *BSD) and GDB's internal register cache. These register sets are already used for core files. We have a gdbarch_regset_from_core_section() function that returns the appropriate register set for a particular core section. See corelow.c and fbsd-proc.c for how this is used to read and write core files. Jim Blandy is currently working on thread-related stuff for Linux (powerpc and perhaps i386) that's going to use these registers sets. We'll probably need to introduce a new gdbarch_regset_from_thread_xxx() for the thread stuff. The NetBSD stuff should use similar code. If you have any questions, or just want to show some code, please don't hesitate to bug me about it. Cheers Mark