summaryrefslogtreecommitdiff
path: root/gdb/regcache.h
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2018-02-21 11:20:03 +0000
committerYao Qi <yao.qi@linaro.org>2018-02-21 11:20:03 +0000
commitf3384e664de76c4bb9f8fd9920afcec86557f1f0 (patch)
treef7cf6fb743e29091c8d8e61e16bfd71723e1abf7 /gdb/regcache.h
parentc8ec2f334c3751c28d5f952d07dea9c0558ca0a0 (diff)
downloadbinutils-gdb-f3384e664de76c4bb9f8fd9920afcec86557f1f0.tar.gz
Replace regcache::dump with class register_dump
Nowadays, we need to dump registers contents from "readwrite" regcache and "readonly" regcache, if (target_has_registers) get_current_regcache ()->dump (out, what_to_dump); else { /* For the benefit of "maint print registers" & co when debugging an executable, allow dumping a regcache even when there is no thread selected / no registers. */ regcache dummy_regs (target_gdbarch ()); dummy_regs.dump (out, what_to_dump); } since we'll have two different types/classes for "readwrite" regcache and "readonly" regcache, we have to move dump method to their parent class, reg_buffer. However, the functionality of "dump" looks unnecessary to reg_buffer (because some dump modes like regcache_dump_none, regcache_dump_remote and regcache_dump_groups don't need reg_buffer at all, they need gdbarch to do the dump), so I decide to move "dump" into a separate classes, and each sub-class is about each mode of dump. gdb: 2018-02-21 Yao Qi <yao.qi@linaro.org> * regcache.c (class register_dump): New class. (register_dump_regcache, register_dump_none): New class. (register_dump_remote, register_dump_groups): New class. (regcache_print): Update. * regcache.h (regcache_dump_what): Move it to regcache.c. (regcache) <dump>: Remove.
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r--gdb/regcache.h9
1 files changed, 0 insertions, 9 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h
index beebf99c05e..a377d2d4def 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -194,13 +194,6 @@ typedef enum register_status (regcache_cooked_read_ftype) (void *src,
int regnum,
gdb_byte *buf);
-enum regcache_dump_what
-{
- regcache_dump_none, regcache_dump_raw,
- regcache_dump_cooked, regcache_dump_groups,
- regcache_dump_remote
-};
-
/* A (register_number, register_value) pair. */
typedef struct cached_reg
@@ -374,8 +367,6 @@ public:
void collect_regset (const struct regset *regset, int regnum,
void *buf, size_t size) const;
- void dump (ui_file *file, enum regcache_dump_what what_to_dump);
-
ptid_t ptid () const
{
return m_ptid;