diff options
author | Yao Qi <yao.qi@linaro.org> | 2018-01-22 11:02:48 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2018-01-22 11:02:48 +0000 |
commit | 3f5a868b2277a3678f7eeb8fdf88935913b5918b (patch) | |
tree | 7eeeee8c91057e5e14f958e9f7e5bf112e1aec89 /gdb/jit.c | |
parent | de4cb04a20782b817fc80b49bba83b43cf1cb85d (diff) | |
download | gdb-3f5a868b2277a3678f7eeb8fdf88935913b5918b.zip gdb-3f5a868b2277a3678f7eeb8fdf88935913b5918b.tar.gz gdb-3f5a868b2277a3678f7eeb8fdf88935913b5918b.tar.bz2 |
Don't call gdbarch_pseudo_register_read_value in jit.c
gdbarch_pseudo_register_read_value is not implemented in every gdbarch, so
the predicate gdbarch_pseudo_register_read_value_p is needed before
calling it. However, there is no such guard in jit_frame_prev_register, I
am wondering how does jit work on the arch without having gdbarch method
pseudo_register_read_value.
The proper way to get register value is to call cooked_read, and then
create the value object from the buffer.
gdb:
2018-01-22 Yao Qi <yao.qi@linaro.org>
* jit.c (jit_frame_prev_register): Call regcache::cooked_read
instead of gdbarch_pseudo_register_read_value.
Diffstat (limited to 'gdb/jit.c')
-rw-r--r-- | gdb/jit.c | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -1271,19 +1271,13 @@ jit_frame_prev_register (struct frame_info *this_frame, void **cache, int reg) return frame_unwind_got_optimized (this_frame, reg); gdbarch = priv->regcache->arch (); - if (reg < gdbarch_num_regs (gdbarch)) - { - gdb_byte *buf = (gdb_byte *) alloca (register_size (gdbarch, reg)); - enum register_status status; + gdb_byte *buf = (gdb_byte *) alloca (register_size (gdbarch, reg)); + enum register_status status = priv->regcache->cooked_read (reg, buf); - status = regcache_raw_read (priv->regcache, reg, buf); - if (status == REG_VALID) - return frame_unwind_got_bytes (this_frame, reg, buf); - else - return frame_unwind_got_optimized (this_frame, reg); - } + if (status == REG_VALID) + return frame_unwind_got_bytes (this_frame, reg, buf); else - return gdbarch_pseudo_register_read_value (gdbarch, priv->regcache, reg); + return frame_unwind_got_optimized (this_frame, reg); } /* Relay everything back to the unwinder registered by the JIT debug |