GDB (API)
/home/stan/gdb/src/gdb/regset.c
Go to the documentation of this file.
00001 /* Manage register sets.
00002 
00003    Copyright (C) 2004-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 #include "defs.h"
00021 #include "regset.h"
00022 
00023 #include "gdb_assert.h"
00024 
00025 /* Allocate a fresh 'struct regset' whose supply_regset function is
00026    SUPPLY_REGSET, and whose collect_regset function is COLLECT_REGSET.
00027    If the regset has no collect_regset function, pass NULL for
00028    COLLECT_REGSET.
00029 
00030    The object returned is allocated on ARCH's obstack.  */
00031 
00032 struct regset *
00033 regset_alloc (struct gdbarch *arch,
00034               supply_regset_ftype *supply_regset,
00035               collect_regset_ftype *collect_regset)
00036 {
00037   struct regset *regset = GDBARCH_OBSTACK_ZALLOC (arch, struct regset);
00038 
00039   regset->arch = arch;
00040   regset->supply_regset = supply_regset;
00041   regset->collect_regset = collect_regset;
00042 
00043   return regset;
00044 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines