mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
[gdb/tdep] Use raw_supply_zeroed for IA-64 gr0 and fr0 regs
Use reg_buffer::raw_supply_zeroed for IA-64 registers gr0 and fr0. Tested by rebuilding on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
@@ -490,7 +490,6 @@ supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
|
|||||||
{
|
{
|
||||||
int regi;
|
int regi;
|
||||||
const char *from;
|
const char *from;
|
||||||
const gdb_byte f_zero[16] = { 0 };
|
|
||||||
const gdb_byte f_one[16] =
|
const gdb_byte f_one[16] =
|
||||||
{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
|
{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
@@ -499,7 +498,7 @@ supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
|
|||||||
for fr0/fr1 and always supply their expected values. */
|
for fr0/fr1 and always supply their expected values. */
|
||||||
|
|
||||||
/* fr0 is always read as zero. */
|
/* fr0 is always read as zero. */
|
||||||
regcache->raw_supply (IA64_FR0_REGNUM, f_zero);
|
regcache->raw_supply_zeroed (IA64_FR0_REGNUM);
|
||||||
/* fr1 is always read as one (1.0). */
|
/* fr1 is always read as one (1.0). */
|
||||||
regcache->raw_supply (IA64_FR1_REGNUM, f_one);
|
regcache->raw_supply (IA64_FR1_REGNUM, f_one);
|
||||||
|
|
||||||
@@ -740,20 +739,14 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
|
|||||||
/* r0 cannot be fetched but is always zero. */
|
/* r0 cannot be fetched but is always zero. */
|
||||||
if (regnum == IA64_GR0_REGNUM)
|
if (regnum == IA64_GR0_REGNUM)
|
||||||
{
|
{
|
||||||
const gdb_byte zero[8] = { 0 };
|
regcache->raw_supply_zeroed (regnum);
|
||||||
|
|
||||||
gdb_assert (sizeof (zero) == register_size (gdbarch, regnum));
|
|
||||||
regcache->raw_supply (regnum, zero);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fr0 cannot be fetched but is always zero. */
|
/* fr0 cannot be fetched but is always zero. */
|
||||||
if (regnum == IA64_FR0_REGNUM)
|
if (regnum == IA64_FR0_REGNUM)
|
||||||
{
|
{
|
||||||
const gdb_byte f_zero[16] = { 0 };
|
regcache->raw_supply_zeroed (regnum);
|
||||||
|
|
||||||
gdb_assert (sizeof (f_zero) == register_size (gdbarch, regnum));
|
|
||||||
regcache->raw_supply (regnum, f_zero);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -174,7 +174,6 @@ ia64_linux_supply_fpregset (const struct regset *regset,
|
|||||||
struct regcache *regcache,
|
struct regcache *regcache,
|
||||||
int regnum, const void *regs, size_t len)
|
int regnum, const void *regs, size_t len)
|
||||||
{
|
{
|
||||||
const gdb_byte f_zero[16] = { 0 };
|
|
||||||
const gdb_byte f_one[16] =
|
const gdb_byte f_one[16] =
|
||||||
{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
|
{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
@@ -184,7 +183,7 @@ ia64_linux_supply_fpregset (const struct regset *regset,
|
|||||||
did the same. So ignore whatever might be recorded in fpregset_t
|
did the same. So ignore whatever might be recorded in fpregset_t
|
||||||
for fr0/fr1 and always supply their expected values. */
|
for fr0/fr1 and always supply their expected values. */
|
||||||
if (regnum == -1 || regnum == IA64_FR0_REGNUM)
|
if (regnum == -1 || regnum == IA64_FR0_REGNUM)
|
||||||
regcache->raw_supply (IA64_FR0_REGNUM, f_zero);
|
regcache->raw_supply_zeroed (IA64_FR0_REGNUM);
|
||||||
if (regnum == -1 || regnum == IA64_FR1_REGNUM)
|
if (regnum == -1 || regnum == IA64_FR1_REGNUM)
|
||||||
regcache->raw_supply (IA64_FR1_REGNUM, f_one);
|
regcache->raw_supply (IA64_FR1_REGNUM, f_one);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user