aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-10-02 15:09:14 +0100
committerYao Qi <yao.qi@linaro.org>2017-10-13 11:52:11 +0100
commitee085f442ba373132a5c10557022bc7025dae270 (patch)
treef58d31ecd1b0e4548cdd25d3d10ace4a92d6e65c
parentc2db73a25d7cdd14f68a9efb2eec895c0e033225 (diff)
downloadfsf-binutils-gdb-ee085f442ba373132a5c10557022bc7025dae270.zip
fsf-binutils-gdb-ee085f442ba373132a5c10557022bc7025dae270.tar.gz
fsf-binutils-gdb-ee085f442ba373132a5c10557022bc7025dae270.tar.bz2
Simplify {supply,fill}_{g,fp}regset
{supply,fill}_{g,fp}regset methods need only to access reg_buffer, instead of regcache, so this patch change parameter type to reg_buffer. Only works for aarch64 native gdb: 2017-10-02 Yao Qi <yao.qi@linaro.org> : * aarch64-linux-nat.c (aarch64_linux_store_inferior_registers): (fill_gregset): - (fill_gregset): + (supply_gregset): - (supply_gregset): + (supply_gregset): (fill_fpregset): - (fill_fpregset): + (supply_fpregset): - (supply_fpregset): + * gregset.h (struct regcache;):
-rw-r--r--gdb/aarch64-linux-nat.c32
-rw-r--r--gdb/gregset.h10
2 files changed, 21 insertions, 21 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 6ad6f66..2ddf85f 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -383,23 +383,23 @@ aarch64_linux_store_inferior_registers (struct target_ops *ops,
do this for all registers. */
void
-fill_gregset (const struct regcache *regcache,
+fill_gregset (const reg_buffer *regcache,
gdb_gregset_t *gregsetp, int regno)
{
- regcache_collect_regset (&aarch64_linux_gregset, regcache,
- regno, (gdb_byte *) gregsetp,
- AARCH64_LINUX_SIZEOF_GREGSET);
+ regcache->collect_regset (&aarch64_linux_gregset, regno,
+ (gdb_byte *) gregsetp,
+ AARCH64_LINUX_SIZEOF_GREGSET);
}
/* Fill GDB's register array with the general-purpose register values
in *GREGSETP. */
void
-supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
+supply_gregset (reg_buffer *regcache, const gdb_gregset_t *gregsetp)
{
- regcache_supply_regset (&aarch64_linux_gregset, regcache, -1,
- (const gdb_byte *) gregsetp,
- AARCH64_LINUX_SIZEOF_GREGSET);
+ regcache->supply_regset (&aarch64_linux_gregset, -1,
+ (const gdb_byte *) gregsetp,
+ AARCH64_LINUX_SIZEOF_GREGSET);
}
/* Fill register REGNO (if it is a floating-point register) in
@@ -407,23 +407,23 @@ supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
do this for all registers. */
void
-fill_fpregset (const struct regcache *regcache,
+fill_fpregset (const reg_buffer *regcache,
gdb_fpregset_t *fpregsetp, int regno)
{
- regcache_collect_regset (&aarch64_linux_fpregset, regcache,
- regno, (gdb_byte *) fpregsetp,
- AARCH64_LINUX_SIZEOF_FPREGSET);
+ regcache->collect_regset (&aarch64_linux_fpregset, regno,
+ (gdb_byte *) fpregsetp,
+ AARCH64_LINUX_SIZEOF_FPREGSET);
}
/* Fill GDB's register array with the floating-point register values
in *FPREGSETP. */
void
-supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
+supply_fpregset (reg_buffer *regcache, const gdb_fpregset_t *fpregsetp)
{
- regcache_supply_regset (&aarch64_linux_fpregset, regcache, -1,
- (const gdb_byte *) fpregsetp,
- AARCH64_LINUX_SIZEOF_FPREGSET);
+ regcache->supply_regset (&aarch64_linux_fpregset, -1,
+ (const gdb_byte *) fpregsetp,
+ AARCH64_LINUX_SIZEOF_FPREGSET);
}
/* linux_nat_new_fork hook. */
diff --git a/gdb/gregset.h b/gdb/gregset.h
index 3101edc..7c70550 100644
--- a/gdb/gregset.h
+++ b/gdb/gregset.h
@@ -34,7 +34,7 @@
typedef GDB_GREGSET_T gdb_gregset_t;
typedef GDB_FPREGSET_T gdb_fpregset_t;
-struct regcache;
+class reg_buffer;
/* A gregset is a data structure supplied by the native OS containing
the general register values of the debugged process. Usually this
@@ -46,18 +46,18 @@ struct regcache;
/* Copy register values from the native target gregset/fpregset
into GDB's internal register cache. */
-extern void supply_gregset (struct regcache *regcache,
+extern void supply_gregset (reg_buffer *regcache,
const gdb_gregset_t *gregs);
-extern void supply_fpregset (struct regcache *regcache,
+extern void supply_fpregset (reg_buffer *regcache,
const gdb_fpregset_t *fpregs);
/* Copy register values from GDB's register cache into
the native target gregset/fpregset. If regno is -1,
copy all the registers. */
-extern void fill_gregset (const struct regcache *regcache,
+extern void fill_gregset (const reg_buffer *regcache,
gdb_gregset_t *gregs, int regno);
-extern void fill_fpregset (const struct regcache *regcache,
+extern void fill_fpregset (const reg_buffer *regcache,
gdb_fpregset_t *fpregs, int regno);
#endif