From 9f3a16025f433a305decd493e1d551d54bd1f3c8 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 1 Jan 2007 11:17:28 +0000 Subject: [PATCH] * mi/mi-main.c (mi_cmd_data_write_register_values): Use regcache_cooked_write_signed instead of deprecated_write_register_bytes. --- gdb/ChangeLog | 6 ++++++ gdb/mi/mi-main.c | 27 ++++++++------------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 554fc3781bf..d0f43cda297 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2007-01-01 Mark Kettenis + + * mi/mi-main.c (mi_cmd_data_write_register_values): Use + regcache_cooked_write_signed instead of + deprecated_write_register_bytes. + 2007-01-01 Joel Brobecker * config/djgpp/fnchange.lst: Add entry for ChangeLog-2006. diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index abb43f33241..98b7b6d86f5 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -545,10 +545,7 @@ get_register (int regnum, int format) enum mi_cmd_result mi_cmd_data_write_register_values (char *command, char **argv, int argc) { - int regnum; - int i; - int numregs; - LONGEST value; + int numregs, i; char format; /* Note that the test for a valid register must include checking the @@ -587,26 +584,18 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc) for (i = 1; i < argc; i = i + 2) { - regnum = atoi (argv[i]); + int regnum = atoi (argv[i]); - if (regnum >= 0 - && regnum < numregs - && REGISTER_NAME (regnum) != NULL - && *REGISTER_NAME (regnum) != '\000') + if (regnum >= 0 && regnum < numregs + && REGISTER_NAME (regnum) && *REGISTER_NAME (regnum)) { - void *buffer; - struct cleanup *old_chain; + LONGEST value; - /* Get the value as a number */ + /* Get the value as a number. */ value = parse_and_eval_address (argv[i + 1]); - /* Get the value into an array */ - buffer = xmalloc (DEPRECATED_REGISTER_SIZE); - old_chain = make_cleanup (xfree, buffer); - store_signed_integer (buffer, DEPRECATED_REGISTER_SIZE, value); + /* Write it down */ - deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (regnum), buffer, register_size (current_gdbarch, regnum)); - /* Free the buffer. */ - do_cleanups (old_chain); + regcache_cooked_write_signed (current_regcache, regnum, value); } else { -- 2.30.2