- /* Value, raw. */
- if (what_to_dump == regcache_dump_raw)
- {
- if (regnum < 0)
- fprintf_unfiltered (file, "Raw value");
- else if (regnum >= num_raw_registers ())
- fprintf_unfiltered (file, "<cooked>");
- else if (get_register_status (regnum) == REG_UNKNOWN)
- fprintf_unfiltered (file, "<invalid>");
- else if (get_register_status (regnum) == REG_UNAVAILABLE)
- fprintf_unfiltered (file, "<unavailable>");
- else
- {
- raw_update (regnum);
- print_hex_chars (file, register_buffer (regnum),
- m_descr->sizeof_register[regnum],
- gdbarch_byte_order (gdbarch), true);
- }
- }
-
- /* Value, cooked. */
- if (what_to_dump == regcache_dump_cooked)
- {
- if (regnum < 0)
- fprintf_unfiltered (file, "Cooked value");
- else
- {
- const gdb_byte *buf = NULL;
- enum register_status status;
- struct value *value = NULL;
-
- if (regnum < num_raw_registers ())
- {
- raw_update (regnum);
- status = get_register_status (regnum);
- buf = register_buffer (regnum);
- }
- else
- {
- value = cooked_read_value (regnum);
-
- if (!value_optimized_out (value)
- && value_entirely_available (value))
- {
- status = REG_VALID;
- buf = value_contents_all (value);
- }
- else
- status = REG_UNAVAILABLE;
- }
-
- if (status == REG_UNKNOWN)
- fprintf_unfiltered (file, "<invalid>");
- else if (status == REG_UNAVAILABLE)
- fprintf_unfiltered (file, "<unavailable>");
- else
- print_hex_chars (file, buf,
- m_descr->sizeof_register[regnum],
- gdbarch_byte_order (gdbarch), true);
-
- if (value != NULL)
- {
- release_value (value);
- value_free (value);
- }
- }
- }
-
- /* Group members. */
- if (what_to_dump == regcache_dump_groups)
- {
- if (regnum < 0)
- fprintf_unfiltered (file, "Groups");
- else
- {
- const char *sep = "";
- struct reggroup *group;
-
- for (group = reggroup_next (gdbarch, NULL);
- group != NULL;
- group = reggroup_next (gdbarch, group))
- {
- if (gdbarch_register_reggroup_p (gdbarch, regnum, group))
- {
- fprintf_unfiltered (file,
- "%s%s", sep, reggroup_name (group));
- sep = ",";
- }
- }
- }
- }
-
- /* Remote packet configuration. */
- if (what_to_dump == regcache_dump_remote)
- {
- if (regnum < 0)
- {
- fprintf_unfiltered (file, "Rmt Nr g/G Offset");
- }
- else if (regnum < num_raw_registers ())
- {
- int pnum, poffset;
-
- if (remote_register_number_and_offset (arch (), regnum,
- &pnum, &poffset))
- fprintf_unfiltered (file, "%7d %11d", pnum, poffset);
- }
- }