#include "observer.h"
#include "exceptions.h"
#include "remote.h"
+#include "valprint.h"
/*
* DATA STRUCTURE
printf_filtered (_("Register cache flushed.\n"));
}
-static void
-dump_endian_bytes (struct ui_file *file, enum bfd_endian endian,
- const gdb_byte *buf, long len)
-{
- int i;
-
- switch (endian)
- {
- case BFD_ENDIAN_BIG:
- for (i = 0; i < len; i++)
- fprintf_unfiltered (file, "%02x", buf[i]);
- break;
- case BFD_ENDIAN_LITTLE:
- for (i = len - 1; i >= 0; i--)
- fprintf_unfiltered (file, "%02x", buf[i]);
- break;
- default:
- internal_error (__FILE__, __LINE__, _("Bad switch"));
- }
-}
-
enum regcache_dump_what
{
regcache_dump_none, regcache_dump_raw,
else
{
regcache_raw_read (regcache, regnum, buf);
- fprintf_unfiltered (file, "0x");
- dump_endian_bytes (file,
- gdbarch_byte_order (gdbarch), buf,
- regcache->descr->sizeof_register[regnum]);
+ print_hex_chars (file, buf,
+ regcache->descr->sizeof_register[regnum],
+ gdbarch_byte_order (gdbarch));
}
}
else if (status == REG_UNAVAILABLE)
fprintf_unfiltered (file, "<unavailable>");
else
- {
- fprintf_unfiltered (file, "0x");
- dump_endian_bytes (file,
- gdbarch_byte_order (gdbarch), buf,
- regcache->descr->sizeof_register[regnum]);
- }
+ print_hex_chars (file, buf,
+ regcache->descr->sizeof_register[regnum],
+ gdbarch_byte_order (gdbarch));
}
}