aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-11-08 15:58:47 +0000
committerYao Qi <yao.qi@linaro.org>2016-11-08 15:58:47 +0000
commitcc977dc7d53ef4546592a4f02a2e06a621beae6f (patch)
treec0d7af183ac92c1daa7c4ad2c009dfee63137682 /gdb
parent3cde5c42d1c1ddcf8bbde5c47233c644370c959c (diff)
downloadgdb-cc977dc7d53ef4546592a4f02a2e06a621beae6f.zip
gdb-cc977dc7d53ef4546592a4f02a2e06a621beae6f.tar.gz
gdb-cc977dc7d53ef4546592a4f02a2e06a621beae6f.tar.bz2
Use get_frame_register_value instead of deprecated_frame_register_read
This patch calls get_frame_register_value instead of deprecated_frame_register_read, so that we can pass value_contents_for_printing to val_print. Both get_frame_register_value and deprecated_frame_register_read call frame_unwind_register_value indirectly, so no functionality is changed by this patch. gdb: 2016-11-08 Yao Qi <yao.qi@linaro.org> * mt-tdep.c (mt_registers_info): Call get_frame_register_value instead of deprecated_frame_register_read. * sh64-tdep.c (sh64_do_register): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/mt-tdep.c10
-rw-r--r--gdb/sh64-tdep.c15
3 files changed, 21 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9036413..227431f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2016-11-08 Yao Qi <yao.qi@linaro.org>
+
+ * mt-tdep.c (mt_registers_info): Call
+ get_frame_register_value instead of
+ deprecated_frame_register_read.
+ * sh64-tdep.c (sh64_do_register): Likewise.
+
2016-11-08 Pedro Alves <palves@redhat.com>
* ax.h (agent_expr_p): Delete.
diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c
index 95dd681..c08e805 100644
--- a/gdb/mt-tdep.c
+++ b/gdb/mt-tdep.c
@@ -712,11 +712,10 @@ mt_registers_info (struct gdbarch *gdbarch,
|| regnum == MT_COPRO_PSEUDOREG_REGNUM)
{
/* Special output handling for the 'coprocessor' register. */
- gdb_byte *buf;
struct value_print_options opts;
+ struct value *val;
- buf = (gdb_byte *) alloca (register_size (gdbarch, MT_COPRO_REGNUM));
- deprecated_frame_register_read (frame, MT_COPRO_REGNUM, buf);
+ val = get_frame_register_value (frame, MT_COPRO_REGNUM);
/* And print. */
regnum = MT_COPRO_PSEUDOREG_REGNUM;
fputs_filtered (gdbarch_register_name (gdbarch, regnum),
@@ -726,8 +725,9 @@ mt_registers_info (struct gdbarch *gdbarch,
file);
get_no_prettyformat_print_options (&opts);
opts.deref_ref = 1;
- val_print (register_type (gdbarch, regnum), buf,
- 0, 0, file, 0, NULL,
+ val_print (register_type (gdbarch, regnum),
+ value_contents_for_printing (val),
+ 0, 0, file, 0, val,
&opts, current_language);
fputs_filtered ("\n", file);
}
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index cbbefdd..9054e20 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -2030,15 +2030,16 @@ static void
sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, int regnum)
{
- unsigned char raw_buffer[MAX_REGISTER_SIZE];
struct value_print_options opts;
+ struct value *val;
fputs_filtered (gdbarch_register_name (gdbarch, regnum), file);
print_spaces_filtered (15 - strlen (gdbarch_register_name
(gdbarch, regnum)), file);
/* Get the data in raw format. */
- if (!deprecated_frame_register_read (frame, regnum, raw_buffer))
+ val = get_frame_register_value (frame, regnum);
+ if (value_optimized_out (val) || !value_entirely_available (val))
{
fprintf_filtered (file, "*value not available*\n");
return;
@@ -2046,13 +2047,15 @@ sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
get_formatted_print_options (&opts, 'x');
opts.deref_ref = 1;
- val_print (register_type (gdbarch, regnum), raw_buffer, 0, 0,
- file, 0, NULL, &opts, current_language);
+ val_print (register_type (gdbarch, regnum),
+ value_contents_for_printing (val), 0, 0,
+ file, 0, val, &opts, current_language);
fprintf_filtered (file, "\t");
get_formatted_print_options (&opts, 0);
opts.deref_ref = 1;
- val_print (register_type (gdbarch, regnum), raw_buffer, 0, 0,
- file, 0, NULL, &opts, current_language);
+ val_print (register_type (gdbarch, regnum),
+ value_contents_for_printing (val), 0, 0,
+ file, 0, val, &opts, current_language);
fprintf_filtered (file, "\n");
}