xref: /dflybsd-src/contrib/gdb-7/gdb/regset.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
15796c8dcSSimon Schubert /* Manage register sets.
25796c8dcSSimon Schubert 
3*ef5ccd6cSJohn Marino    Copyright (C) 2003-2013 Free Software Foundation, Inc.
45796c8dcSSimon Schubert 
55796c8dcSSimon Schubert    This file is part of GDB.
65796c8dcSSimon Schubert 
75796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
85796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
95796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
105796c8dcSSimon Schubert    (at your option) any later version.
115796c8dcSSimon Schubert 
125796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
135796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
145796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
155796c8dcSSimon Schubert    GNU General Public License for more details.
165796c8dcSSimon Schubert 
175796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
185796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
195796c8dcSSimon Schubert 
205796c8dcSSimon Schubert #ifndef REGSET_H
215796c8dcSSimon Schubert #define REGSET_H 1
225796c8dcSSimon Schubert 
235796c8dcSSimon Schubert struct gdbarch;
245796c8dcSSimon Schubert struct regcache;
255796c8dcSSimon Schubert 
265796c8dcSSimon Schubert /* Data structure for the supported register notes in a core file.  */
275796c8dcSSimon Schubert struct core_regset_section
285796c8dcSSimon Schubert {
295796c8dcSSimon Schubert   const char *sect_name;
305796c8dcSSimon Schubert   int size;
31cf7f2e2dSJohn Marino   const char *human_name;
325796c8dcSSimon Schubert };
335796c8dcSSimon Schubert 
345796c8dcSSimon Schubert /* Data structure describing a register set.  */
355796c8dcSSimon Schubert 
365796c8dcSSimon Schubert typedef void (supply_regset_ftype) (const struct regset *, struct regcache *,
375796c8dcSSimon Schubert                                     int, const void *, size_t);
385796c8dcSSimon Schubert typedef void (collect_regset_ftype) (const struct regset *,
395796c8dcSSimon Schubert                                      const struct regcache *,
405796c8dcSSimon Schubert                                      int, void *, size_t);
415796c8dcSSimon Schubert 
425796c8dcSSimon Schubert struct regset
435796c8dcSSimon Schubert {
445796c8dcSSimon Schubert   /* Data pointer for private use by the methods below, presumably
455796c8dcSSimon Schubert      providing some sort of description of the register set.  */
465796c8dcSSimon Schubert   const void *descr;
475796c8dcSSimon Schubert 
485796c8dcSSimon Schubert   /* Function supplying values in a register set to a register cache.  */
495796c8dcSSimon Schubert   supply_regset_ftype *supply_regset;
505796c8dcSSimon Schubert 
515796c8dcSSimon Schubert   /* Function collecting values in a register set from a register cache.  */
525796c8dcSSimon Schubert   collect_regset_ftype *collect_regset;
535796c8dcSSimon Schubert 
545796c8dcSSimon Schubert   /* Architecture associated with the register set.  */
555796c8dcSSimon Schubert   struct gdbarch *arch;
565796c8dcSSimon Schubert };
575796c8dcSSimon Schubert 
585796c8dcSSimon Schubert /* Allocate a fresh 'struct regset' whose supply_regset function is
595796c8dcSSimon Schubert    SUPPLY_REGSET, and whose collect_regset function is COLLECT_REGSET.
605796c8dcSSimon Schubert    If the regset has no collect_regset function, pass NULL for
615796c8dcSSimon Schubert    COLLECT_REGSET.
625796c8dcSSimon Schubert 
635796c8dcSSimon Schubert    The object returned is allocated on ARCH's obstack.  */
645796c8dcSSimon Schubert 
655796c8dcSSimon Schubert extern struct regset *regset_alloc (struct gdbarch *arch,
665796c8dcSSimon Schubert                                     supply_regset_ftype *supply_regset,
675796c8dcSSimon Schubert                                     collect_regset_ftype *collect_regset);
685796c8dcSSimon Schubert 
695796c8dcSSimon Schubert #endif /* regset.h */
70