aboutsummaryrefslogtreecommitdiff
path: root/gdb/regformats
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2018-03-26 10:39:24 +0100
committerAlan Hayward <alan.hayward@arm.com>2018-03-26 10:54:55 +0100
commit5cd3e386e0ac84b0ba1e0737853f4504ba24f677 (patch)
tree16ec0192a901f38def1cef893c650f8aec1912ab /gdb/regformats
parentaf9d57d205eb656a01b9688c3efa591ad8f1a2a9 (diff)
downloadbinutils-5cd3e386e0ac84b0ba1e0737853f4504ba24f677.zip
binutils-5cd3e386e0ac84b0ba1e0737853f4504ba24f677.tar.gz
binutils-5cd3e386e0ac84b0ba1e0737853f4504ba24f677.tar.bz2
Make gdbserver reg_defs a vector of objects
gdb/ * regformats/regdef.h (reg): Add constructors. gdb/gdbserver/ * regcache.c (find_register_by_number): Return a ref. (find_regno): Use references. (register_size): Likewise. (register_data): Likewise. * tdesc.c (target_desc::~target_desc): Remove free calls. (target_desc::operator==): Use std::vector compare. (init_target_desc): Use reference. (tdesc_create_reg): Use reg constructors. * tdesc.h (struct target_desc): Replace pointer with object.
Diffstat (limited to 'gdb/regformats')
-rw-r--r--gdb/regformats/regdef.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/regformats/regdef.h b/gdb/regformats/regdef.h
index 262d03c..4775e86 100644
--- a/gdb/regformats/regdef.h
+++ b/gdb/regformats/regdef.h
@@ -21,6 +21,18 @@
struct reg
{
+ reg ()
+ : name (""),
+ offset (0),
+ size (0)
+ {}
+
+ reg (const char *_name, int _size)
+ : name (_name),
+ offset (0),
+ size (_size)
+ {}
+
/* The name of this register - NULL for pad entries. */
const char *name;