GDB (API)
/home/stan/gdb/src/gdb/regset.h
Go to the documentation of this file.
00001 /* Manage register sets.
00002 
00003    Copyright (C) 2003-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #ifndef REGSET_H
00021 #define REGSET_H 1
00022 
00023 struct gdbarch;
00024 struct regcache;
00025 
00026 /* Data structure for the supported register notes in a core file.  */
00027 struct core_regset_section
00028 {
00029   const char *sect_name;
00030   int size;
00031   const char *human_name;
00032 };
00033 
00034 /* Data structure describing a register set.  */
00035 
00036 typedef void (supply_regset_ftype) (const struct regset *, struct regcache *,
00037                                     int, const void *, size_t);
00038 typedef void (collect_regset_ftype) (const struct regset *, 
00039                                      const struct regcache *,
00040                                      int, void *, size_t);
00041 
00042 struct regset
00043 {
00044   /* Data pointer for private use by the methods below, presumably
00045      providing some sort of description of the register set.  */
00046   const void *descr;
00047 
00048   /* Function supplying values in a register set to a register cache.  */
00049   supply_regset_ftype *supply_regset;
00050 
00051   /* Function collecting values in a register set from a register cache.  */
00052   collect_regset_ftype *collect_regset;
00053 
00054   /* Architecture associated with the register set.  */
00055   struct gdbarch *arch;
00056 };
00057 
00058 /* Allocate a fresh 'struct regset' whose supply_regset function is
00059    SUPPLY_REGSET, and whose collect_regset function is COLLECT_REGSET.
00060    If the regset has no collect_regset function, pass NULL for
00061    COLLECT_REGSET.
00062 
00063    The object returned is allocated on ARCH's obstack.  */
00064 
00065 extern struct regset *regset_alloc (struct gdbarch *arch,
00066                                     supply_regset_ftype *supply_regset,
00067                                     collect_regset_ftype *collect_regset);
00068 
00069 #endif /* regset.h */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines