mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 17:18:24 +08:00
fbsd-nat: Return a bool from fetch_register_set and store_register_set.
Change these helper functions to return true if they did any work.
This commit is contained in:
@ -1611,7 +1611,7 @@ fbsd_nat_target::supports_disable_randomization ()
|
|||||||
|
|
||||||
/* See fbsd-nat.h. */
|
/* See fbsd-nat.h. */
|
||||||
|
|
||||||
void
|
bool
|
||||||
fbsd_nat_target::fetch_register_set (struct regcache *regcache, int regnum,
|
fbsd_nat_target::fetch_register_set (struct regcache *regcache, int regnum,
|
||||||
int fetch_op, const struct regset *regset,
|
int fetch_op, const struct regset *regset,
|
||||||
void *regs, size_t size)
|
void *regs, size_t size)
|
||||||
@ -1627,12 +1627,14 @@ fbsd_nat_target::fetch_register_set (struct regcache *regcache, int regnum,
|
|||||||
perror_with_name (_("Couldn't get registers"));
|
perror_with_name (_("Couldn't get registers"));
|
||||||
|
|
||||||
regcache->supply_regset (regset, regnum, regs, size);
|
regcache->supply_regset (regset, regnum, regs, size);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See fbsd-nat.h. */
|
/* See fbsd-nat.h. */
|
||||||
|
|
||||||
void
|
bool
|
||||||
fbsd_nat_target::store_register_set (struct regcache *regcache, int regnum,
|
fbsd_nat_target::store_register_set (struct regcache *regcache, int regnum,
|
||||||
int fetch_op, int store_op,
|
int fetch_op, int store_op,
|
||||||
const struct regset *regset, void *regs,
|
const struct regset *regset, void *regs,
|
||||||
@ -1652,7 +1654,9 @@ fbsd_nat_target::store_register_set (struct regcache *regcache, int regnum,
|
|||||||
|
|
||||||
if (ptrace (store_op, pid, (PTRACE_TYPE_ARG3) regs, 0) == -1)
|
if (ptrace (store_op, pid, (PTRACE_TYPE_ARG3) regs, 0) == -1)
|
||||||
perror_with_name (_("Couldn't write registers"));
|
perror_with_name (_("Couldn't write registers"));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _initialize_fbsd_nat ();
|
void _initialize_fbsd_nat ();
|
||||||
|
@ -120,12 +120,15 @@ private:
|
|||||||
of registers to a native thread.
|
of registers to a native thread.
|
||||||
|
|
||||||
The caller must provide storage for the set of registers in REGS,
|
The caller must provide storage for the set of registers in REGS,
|
||||||
and SIZE is the size of the storage. */
|
and SIZE is the size of the storage.
|
||||||
|
|
||||||
void fetch_register_set (struct regcache *regcache, int regnum, int fetch_op,
|
Returns true if the register set was transferred due to a
|
||||||
|
matching REGNUM.*/
|
||||||
|
|
||||||
|
bool fetch_register_set (struct regcache *regcache, int regnum, int fetch_op,
|
||||||
const struct regset *regset, void *regs, size_t size);
|
const struct regset *regset, void *regs, size_t size);
|
||||||
|
|
||||||
void store_register_set (struct regcache *regcache, int regnum, int fetch_op,
|
bool store_register_set (struct regcache *regcache, int regnum, int fetch_op,
|
||||||
int store_op, const struct regset *regset,
|
int store_op, const struct regset *regset,
|
||||||
void *regs, size_t size);
|
void *regs, size_t size);
|
||||||
protected:
|
protected:
|
||||||
@ -133,21 +136,21 @@ protected:
|
|||||||
type such as 'struct reg' or 'struct fpreg'. */
|
type such as 'struct reg' or 'struct fpreg'. */
|
||||||
|
|
||||||
template <class Regset>
|
template <class Regset>
|
||||||
void fetch_register_set (struct regcache *regcache, int regnum, int fetch_op,
|
bool fetch_register_set (struct regcache *regcache, int regnum, int fetch_op,
|
||||||
const struct regset *regset)
|
const struct regset *regset)
|
||||||
{
|
{
|
||||||
Regset regs;
|
Regset regs;
|
||||||
fetch_register_set (regcache, regnum, fetch_op, regset, ®s,
|
return fetch_register_set (regcache, regnum, fetch_op, regset, ®s,
|
||||||
sizeof (regs));
|
sizeof (regs));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Regset>
|
template <class Regset>
|
||||||
void store_register_set (struct regcache *regcache, int regnum, int fetch_op,
|
bool store_register_set (struct regcache *regcache, int regnum, int fetch_op,
|
||||||
int store_op, const struct regset *regset)
|
int store_op, const struct regset *regset)
|
||||||
{
|
{
|
||||||
Regset regs;
|
Regset regs;
|
||||||
store_register_set (regcache, regnum, fetch_op, store_op, regset, ®s,
|
return store_register_set (regcache, regnum, fetch_op, store_op, regset,
|
||||||
sizeof (regs));
|
®s, sizeof (regs));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user