This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Some regset-related cleanup for i386bsd-nat.c


   From: "Nathan J. Williams" <nathanw@wasabisystems.com>
   Date: 08 Jun 2004 16:49:15 -0400

   Mark Kettenis <kettenis@chello.nl> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]