summaryrefslogtreecommitdiff
path: root/gdb/i387-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/i387-tdep.c')
-rw-r--r--gdb/i387-tdep.c156
1 files changed, 78 insertions, 78 deletions
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 2f0b6509457..f056ea59347 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -42,7 +42,7 @@ print_i387_value (struct gdbarch *gdbarch,
point, 19 for the digits and 6 for the exponent adds up to 27. */
const struct type *type = i387_ext_type (gdbarch);
std::string str = target_float_to_string (raw, type, " %-+27.19g");
- fprintf_filtered (file, "%s", str.c_str ());
+ gdb_printf (file, "%s", str.c_str ());
}
/* Print the classification for the register contents RAW. */
@@ -67,16 +67,16 @@ print_i387_ext (struct gdbarch *gdbarch,
{
if (fraction[0] == 0x00000000 && fraction[1] == 0x00000000)
/* Infinity. */
- fprintf_filtered (file, " %cInf", (sign ? '-' : '+'));
+ gdb_printf (file, " %cInf", (sign ? '-' : '+'));
else if (sign && fraction[0] == 0x00000000 && fraction[1] == 0x40000000)
/* Real Indefinite (QNaN). */
- fputs_filtered (" Real Indefinite (QNaN)", file);
+ gdb_puts (" Real Indefinite (QNaN)", file);
else if (fraction[1] & 0x40000000)
/* QNaN. */
- fputs_filtered (" QNaN", file);
+ gdb_puts (" QNaN", file);
else
/* SNaN. */
- fputs_filtered (" SNaN", file);
+ gdb_puts (" SNaN", file);
}
else if (exponent < 0x7fff && exponent > 0x0000 && integer)
/* Normal. */
@@ -88,14 +88,14 @@ print_i387_ext (struct gdbarch *gdbarch,
if (integer)
/* Pseudo-denormal. */
- fputs_filtered (" Pseudo-denormal", file);
+ gdb_puts (" Pseudo-denormal", file);
else if (fraction[0] || fraction[1])
/* Denormal. */
- fputs_filtered (" Denormal", file);
+ gdb_puts (" Denormal", file);
}
else
/* Unsupported. */
- fputs_filtered (" Unsupported", file);
+ gdb_puts (" Unsupported", file);
}
/* Print the status word STATUS. If STATUS_P is false, then STATUS
@@ -105,35 +105,35 @@ static void
print_i387_status_word (int status_p,
unsigned int status, struct ui_file *file)
{
- fprintf_filtered (file, "Status Word: ");
+ gdb_printf (file, "Status Word: ");
if (!status_p)
{
- fprintf_filtered (file, "%s\n", _("<unavailable>"));
+ gdb_printf (file, "%s\n", _("<unavailable>"));
return;
}
- fprintf_filtered (file, "%s", hex_string_custom (status, 4));
- fputs_filtered (" ", file);
- fprintf_filtered (file, " %s", (status & 0x0001) ? "IE" : " ");
- fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " ");
- fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " ");
- fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " ");
- fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " ");
- fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " ");
- fputs_filtered (" ", file);
- fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " ");
- fputs_filtered (" ", file);
- fprintf_filtered (file, " %s", (status & 0x0040) ? "SF" : " ");
- fputs_filtered (" ", file);
- fprintf_filtered (file, " %s", (status & 0x0100) ? "C0" : " ");
- fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " ");
- fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " ");
- fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " ");
-
- fputs_filtered ("\n", file);
-
- fprintf_filtered (file,
- " TOP: %d\n", ((status >> 11) & 7));
+ gdb_printf (file, "%s", hex_string_custom (status, 4));
+ gdb_puts (" ", file);
+ gdb_printf (file, " %s", (status & 0x0001) ? "IE" : " ");
+ gdb_printf (file, " %s", (status & 0x0002) ? "DE" : " ");
+ gdb_printf (file, " %s", (status & 0x0004) ? "ZE" : " ");
+ gdb_printf (file, " %s", (status & 0x0008) ? "OE" : " ");
+ gdb_printf (file, " %s", (status & 0x0010) ? "UE" : " ");
+ gdb_printf (file, " %s", (status & 0x0020) ? "PE" : " ");
+ gdb_puts (" ", file);
+ gdb_printf (file, " %s", (status & 0x0080) ? "ES" : " ");
+ gdb_puts (" ", file);
+ gdb_printf (file, " %s", (status & 0x0040) ? "SF" : " ");
+ gdb_puts (" ", file);
+ gdb_printf (file, " %s", (status & 0x0100) ? "C0" : " ");
+ gdb_printf (file, " %s", (status & 0x0200) ? "C1" : " ");
+ gdb_printf (file, " %s", (status & 0x0400) ? "C2" : " ");
+ gdb_printf (file, " %s", (status & 0x4000) ? "C3" : " ");
+
+ gdb_puts ("\n", file);
+
+ gdb_printf (file,
+ " TOP: %d\n", ((status >> 11) & 7));
}
/* Print the control word CONTROL. If CONTROL_P is false, then
@@ -143,55 +143,55 @@ static void
print_i387_control_word (int control_p,
unsigned int control, struct ui_file *file)
{
- fprintf_filtered (file, "Control Word: ");
+ gdb_printf (file, "Control Word: ");
if (!control_p)
{
- fprintf_filtered (file, "%s\n", _("<unavailable>"));
+ gdb_printf (file, "%s\n", _("<unavailable>"));
return;
}
- fprintf_filtered (file, "%s", hex_string_custom (control, 4));
- fputs_filtered (" ", file);
- fprintf_filtered (file, " %s", (control & 0x0001) ? "IM" : " ");
- fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " ");
- fprintf_filtered (file, " %s", (control & 0x0004) ? "ZM" : " ");
- fprintf_filtered (file, " %s", (control & 0x0008) ? "OM" : " ");
- fprintf_filtered (file, " %s", (control & 0x0010) ? "UM" : " ");
- fprintf_filtered (file, " %s", (control & 0x0020) ? "PM" : " ");
+ gdb_printf (file, "%s", hex_string_custom (control, 4));
+ gdb_puts (" ", file);
+ gdb_printf (file, " %s", (control & 0x0001) ? "IM" : " ");
+ gdb_printf (file, " %s", (control & 0x0002) ? "DM" : " ");
+ gdb_printf (file, " %s", (control & 0x0004) ? "ZM" : " ");
+ gdb_printf (file, " %s", (control & 0x0008) ? "OM" : " ");
+ gdb_printf (file, " %s", (control & 0x0010) ? "UM" : " ");
+ gdb_printf (file, " %s", (control & 0x0020) ? "PM" : " ");
- fputs_filtered ("\n", file);
+ gdb_puts ("\n", file);
- fputs_filtered (" PC: ", file);
+ gdb_puts (" PC: ", file);
switch ((control >> 8) & 3)
{
case 0:
- fputs_filtered ("Single Precision (24-bits)\n", file);
+ gdb_puts ("Single Precision (24-bits)\n", file);
break;
case 1:
- fputs_filtered ("Reserved\n", file);
+ gdb_puts ("Reserved\n", file);
break;
case 2:
- fputs_filtered ("Double Precision (53-bits)\n", file);
+ gdb_puts ("Double Precision (53-bits)\n", file);
break;
case 3:
- fputs_filtered ("Extended Precision (64-bits)\n", file);
+ gdb_puts ("Extended Precision (64-bits)\n", file);
break;
}
- fputs_filtered (" RC: ", file);
+ gdb_puts (" RC: ", file);
switch ((control >> 10) & 3)
{
case 0:
- fputs_filtered ("Round to nearest\n", file);
+ gdb_puts ("Round to nearest\n", file);
break;
case 1:
- fputs_filtered ("Round down\n", file);
+ gdb_puts ("Round down\n", file);
break;
case 2:
- fputs_filtered ("Round up\n", file);
+ gdb_puts ("Round up\n", file);
break;
case 3:
- fputs_filtered ("Round toward zero\n", file);
+ gdb_puts ("Round toward zero\n", file);
break;
}
}
@@ -254,7 +254,7 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
int i;
int tag = -1;
- fprintf_filtered (file, "%sR%d: ", fpreg == top ? "=>" : " ", fpreg);
+ gdb_printf (file, "%sR%d: ", fpreg == top ? "=>" : " ", fpreg);
if (ftag_p)
{
@@ -263,21 +263,21 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
switch (tag)
{
case 0:
- fputs_filtered ("Valid ", file);
+ gdb_puts ("Valid ", file);
break;
case 1:
- fputs_filtered ("Zero ", file);
+ gdb_puts ("Zero ", file);
break;
case 2:
- fputs_filtered ("Special ", file);
+ gdb_puts ("Special ", file);
break;
case 3:
- fputs_filtered ("Empty ", file);
+ gdb_puts ("Empty ", file);
break;
}
}
else
- fputs_filtered ("Unknown ", file);
+ gdb_puts ("Unknown ", file);
regnum = (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep);
regval = get_frame_register_value (frame, regnum);
@@ -286,37 +286,37 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
{
const gdb_byte *raw = value_contents (regval).data ();
- fputs_filtered ("0x", file);
+ gdb_puts ("0x", file);
for (i = 9; i >= 0; i--)
- fprintf_filtered (file, "%02x", raw[i]);
+ gdb_printf (file, "%02x", raw[i]);
if (tag != -1 && tag != 3)
print_i387_ext (gdbarch, raw, file);
}
else
- fprintf_filtered (file, "%s", _("<unavailable>"));
+ gdb_printf (file, "%s", _("<unavailable>"));
- fputs_filtered ("\n", file);
+ gdb_puts ("\n", file);
}
}
- fputs_filtered ("\n", file);
+ gdb_puts ("\n", file);
print_i387_status_word (fstat_p, fstat, file);
print_i387_control_word (fctrl_p, fctrl, file);
- fprintf_filtered (file, "Tag Word: %s\n",
- ftag_p ? hex_string_custom (ftag, 4) : _("<unavailable>"));
- fprintf_filtered (file, "Instruction Pointer: %s:",
- fiseg_p ? hex_string_custom (fiseg, 2) : _("<unavailable>"));
- fprintf_filtered (file, "%s\n",
- fioff_p ? hex_string_custom (fioff, 8) : _("<unavailable>"));
- fprintf_filtered (file, "Operand Pointer: %s:",
- foseg_p ? hex_string_custom (foseg, 2) : _("<unavailable>"));
- fprintf_filtered (file, "%s\n",
- fooff_p ? hex_string_custom (fooff, 8) : _("<unavailable>"));
- fprintf_filtered (file, "Opcode: %s\n",
- fop_p
- ? (hex_string_custom (fop ? (fop | 0xd800) : 0, 4))
- : _("<unavailable>"));
+ gdb_printf (file, "Tag Word: %s\n",
+ ftag_p ? hex_string_custom (ftag, 4) : _("<unavailable>"));
+ gdb_printf (file, "Instruction Pointer: %s:",
+ fiseg_p ? hex_string_custom (fiseg, 2) : _("<unavailable>"));
+ gdb_printf (file, "%s\n",
+ fioff_p ? hex_string_custom (fioff, 8) : _("<unavailable>"));
+ gdb_printf (file, "Operand Pointer: %s:",
+ foseg_p ? hex_string_custom (foseg, 2) : _("<unavailable>"));
+ gdb_printf (file, "%s\n",
+ fooff_p ? hex_string_custom (fooff, 8) : _("<unavailable>"));
+ gdb_printf (file, "Opcode: %s\n",
+ fop_p
+ ? (hex_string_custom (fop ? (fop | 0xd800) : 0, 4))
+ : _("<unavailable>"));
}