]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/mi/mi-main.c
* defs.h (extract_signed_integer, extract_unsigned_integer,
[thirdparty/binutils-gdb.git] / gdb / mi / mi-main.c
index 3d4281f37bd374c3800fd7a0e9e262ddcda6e224..6aa1d08db994366bb97158674215f1b2cb40e144 100644 (file)
@@ -1030,6 +1030,8 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
 void
 mi_cmd_data_write_memory (char *command, char **argv, int argc)
 {
+  struct gdbarch *gdbarch = get_current_arch ();
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR addr;
   char word_format;
   long word_size;
@@ -1087,7 +1089,7 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc)
   /* Get the value into an array.  */
   buffer = xmalloc (word_size);
   old_chain = make_cleanup (xfree, buffer);
-  store_signed_integer (buffer, word_size, value);
+  store_signed_integer (buffer, word_size, byte_order, value);
   /* Write it down to memory.  */
   write_memory (addr, buffer, word_size);
   /* Free the buffer.  */