mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
617a4cbacf
xmalloc. * regset.c (regset_alloc): Renamed from regset_xmalloc. Add 'arch' argument. Allocate the regset on arch's obstack, not using xmalloc. * regset.h (regset_alloc): Update declaration. * am64-tdep.c (amd64_regset_from_core_section): Update call; pass gdbarch argument. * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same. * i386-tdep.c (i386_regset_from_core_section): Same. * i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same. * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same. * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same. * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same. * sparc64obsd-tdep.c (sparc64obsd_init_abi): Same. * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
42 lines
1.3 KiB
C
42 lines
1.3 KiB
C
/* Regset support functions, for GDB.
|
|
|
|
Copyright 2004 Free Software Foundation, Inc.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
#include "defs.h"
|
|
#include "regset.h"
|
|
#include "gdb_assert.h"
|
|
|
|
|
|
struct regset *
|
|
regset_alloc (struct gdbarch *arch,
|
|
const void *descr,
|
|
supply_regset_ftype *supply_regset,
|
|
collect_regset_ftype *collect_regset)
|
|
{
|
|
struct regset *r
|
|
= (struct regset *) gdbarch_obstack_zalloc (arch, sizeof (*r));
|
|
|
|
r->descr = descr;
|
|
r->supply_regset = supply_regset;
|
|
r->collect_regset = collect_regset;
|
|
|
|
return r;
|
|
}
|