forked from Imagelibrary/binutils-gdb
arm-fbsd: Use a static regset for the TLS register set.
This uses custom collect/supply regset handlers which pass the TLS register number from the gdbarch_tdep as the base register number. Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
@@ -58,21 +58,8 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
|
||||
arm_gdbarch_tdep *tdep = gdbarch_tdep<arm_gdbarch_tdep> (gdbarch);
|
||||
|
||||
if (tdep->tls_regnum > 0)
|
||||
{
|
||||
const struct regcache_map_entry arm_fbsd_tlsregmap[] =
|
||||
{
|
||||
{ 1, tdep->tls_regnum, 4 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
const struct regset arm_fbsd_tlsregset =
|
||||
{
|
||||
arm_fbsd_tlsregmap,
|
||||
regcache_supply_regset, regcache_collect_regset
|
||||
};
|
||||
|
||||
fetch_regset<uint32_t> (regcache, regnum, NT_ARM_TLS, &arm_fbsd_tlsregset);
|
||||
}
|
||||
fetch_regset<uint32_t> (regcache, regnum, NT_ARM_TLS, &arm_fbsd_tls_regset,
|
||||
tdep->tls_regnum);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -93,21 +80,8 @@ arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
|
||||
arm_gdbarch_tdep *tdep = gdbarch_tdep<arm_gdbarch_tdep> (gdbarch);
|
||||
|
||||
if (tdep->tls_regnum > 0)
|
||||
{
|
||||
const struct regcache_map_entry arm_fbsd_tlsregmap[] =
|
||||
{
|
||||
{ 1, tdep->tls_regnum, 4 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
const struct regset arm_fbsd_tlsregset =
|
||||
{
|
||||
arm_fbsd_tlsregmap,
|
||||
regcache_supply_regset, regcache_collect_regset
|
||||
};
|
||||
|
||||
store_regset<uint32_t> (regcache, regnum, NT_ARM_TLS, &arm_fbsd_tlsregset);
|
||||
}
|
||||
store_regset<uint32_t> (regcache, regnum, NT_ARM_TLS, &arm_fbsd_tls_regset,
|
||||
tdep->tls_regnum);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user