Fix build issues on NetBSD where the reg symbol exists in public headers.
regformats/regdef.h:22:8: error: redefinition struct
struct reg
^~~
/usr/include/amd64/reg.h:51:8: note: previous definition struct
struct reg {
^~~
gdb/ChangeLog:
* regformats/regdef.h: Put reg in gdb namespace.
gdbserver/ChangeLog:
* regcache.cc (find_register_by_number): Update.
* tdesc.cc (init_target_desc): Likewise.
* tdesc.h (target_desc::reg_defs): Likewise.
+2020-03-17 Kamil Rytarowski <n54@gmx.com>
+
+ * regformats/regdef.h: Put reg in gdb namespace.
+
2020-03-17 Kamil Rytarowski <n54@gmx.com>
* i386-bsd-nat.c (gdb_ptrace): New.
#ifndef REGFORMATS_REGDEF_H
#define REGFORMATS_REGDEF_H
+namespace gdb {
+
struct reg
{
reg (int _offset)
}
};
+} /* namespace gdb */
+
#endif /* REGFORMATS_REGDEF_H */
+2020-03-17 Kamil Rytarowski <n54@gmx.com>
+
+ * regcache.cc (find_register_by_number): Update.
+ * tdesc.cc (init_target_desc): Likewise.
+ * tdesc.h (target_desc::reg_defs): Likewise.
+
2020-03-12 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
/* Return a reference to the description of register N. */
-static const struct reg &
+static const struct gdb::reg &
find_register_by_number (const struct target_desc *tdesc, int n)
{
return tdesc->reg_defs[n];
gdb_assert (regnum == 0 || regnum >= tdesc->reg_defs.size ());
if (regnum != 0)
- tdesc->reg_defs.resize (regnum, reg (offset));
+ tdesc->reg_defs.resize (regnum, gdb::reg (offset));
tdesc->reg_defs.emplace_back (treg->name.c_str (), offset,
treg->bitsize);
{
/* A vector of elements of register definitions that
describe the inferior's register set. */
- std::vector<struct reg> reg_defs;
+ std::vector<struct gdb::reg> reg_defs;
/* The register cache size, in bytes. */
int registers_size;