OLD | NEW |
1 /* Intel 387 floating point stuff. | 1 /* Intel 387 floating point stuff. |
2 | 2 |
3 Copyright (C) 1988-1989, 1991-1994, 1998-2005, 2007-2012 Free | 3 Copyright (C) 1988-1989, 1991-1994, 1998-2005, 2007-2012 Free |
4 Software Foundation, Inc. | 4 Software Foundation, Inc. |
5 | 5 |
6 This file is part of GDB. | 6 This file is part of GDB. |
7 | 7 |
8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 fputs_filtered (" Pseudo-denormal", file); | 106 fputs_filtered (" Pseudo-denormal", file); |
107 else if (fraction[0] || fraction[1]) | 107 else if (fraction[0] || fraction[1]) |
108 /* Denormal. */ | 108 /* Denormal. */ |
109 fputs_filtered (" Denormal", file); | 109 fputs_filtered (" Denormal", file); |
110 } | 110 } |
111 else | 111 else |
112 /* Unsupported. */ | 112 /* Unsupported. */ |
113 fputs_filtered (" Unsupported", file); | 113 fputs_filtered (" Unsupported", file); |
114 } | 114 } |
115 | 115 |
116 /* Print the status word STATUS. */ | 116 /* Print the status word STATUS. If STATUS_P is false, then STATUS |
| 117 was unavailable. */ |
117 | 118 |
118 static void | 119 static void |
119 print_i387_status_word (unsigned int status, struct ui_file *file) | 120 print_i387_status_word (int status_p, |
| 121 » » » unsigned int status, struct ui_file *file) |
120 { | 122 { |
121 fprintf_filtered (file, "Status Word: %s", | 123 fprintf_filtered (file, "Status Word: "); |
122 » » hex_string_custom (status, 4)); | 124 if (!status_p) |
| 125 { |
| 126 fprintf_filtered (file, "%s\n", _("<unavailable>")); |
| 127 return; |
| 128 } |
| 129 |
| 130 fprintf_filtered (file, "%s", hex_string_custom (status, 4)); |
123 fputs_filtered (" ", file); | 131 fputs_filtered (" ", file); |
124 fprintf_filtered (file, " %s", (status & 0x0001) ? "IE" : " "); | 132 fprintf_filtered (file, " %s", (status & 0x0001) ? "IE" : " "); |
125 fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " "); | 133 fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " "); |
126 fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " "); | 134 fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " "); |
127 fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " "); | 135 fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " "); |
128 fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " "); | 136 fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " "); |
129 fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " "); | 137 fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " "); |
130 fputs_filtered (" ", file); | 138 fputs_filtered (" ", file); |
131 fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " "); | 139 fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " "); |
132 fputs_filtered (" ", file); | 140 fputs_filtered (" ", file); |
133 fprintf_filtered (file, " %s", (status & 0x0040) ? "SF" : " "); | 141 fprintf_filtered (file, " %s", (status & 0x0040) ? "SF" : " "); |
134 fputs_filtered (" ", file); | 142 fputs_filtered (" ", file); |
135 fprintf_filtered (file, " %s", (status & 0x0100) ? "C0" : " "); | 143 fprintf_filtered (file, " %s", (status & 0x0100) ? "C0" : " "); |
136 fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " "); | 144 fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " "); |
137 fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " "); | 145 fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " "); |
138 fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " "); | 146 fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " "); |
139 | 147 |
140 fputs_filtered ("\n", file); | 148 fputs_filtered ("\n", file); |
141 | 149 |
142 fprintf_filtered (file, | 150 fprintf_filtered (file, |
143 " TOP: %d\n", ((status >> 11) & 7)); | 151 " TOP: %d\n", ((status >> 11) & 7)); |
144 } | 152 } |
145 | 153 |
146 /* Print the control word CONTROL. */ | 154 /* Print the control word CONTROL. If CONTROL_P is false, then |
| 155 CONTROL was unavailable. */ |
147 | 156 |
148 static void | 157 static void |
149 print_i387_control_word (unsigned int control, struct ui_file *file) | 158 print_i387_control_word (int control_p, |
| 159 » » » unsigned int control, struct ui_file *file) |
150 { | 160 { |
151 fprintf_filtered (file, "Control Word: %s", | 161 fprintf_filtered (file, "Control Word: "); |
152 » » hex_string_custom (control, 4)); | 162 if (!control_p) |
| 163 { |
| 164 fprintf_filtered (file, "%s\n", _("<unavailable>")); |
| 165 return; |
| 166 } |
| 167 |
| 168 fprintf_filtered (file, "%s", hex_string_custom (control, 4)); |
153 fputs_filtered (" ", file); | 169 fputs_filtered (" ", file); |
154 fprintf_filtered (file, " %s", (control & 0x0001) ? "IM" : " "); | 170 fprintf_filtered (file, " %s", (control & 0x0001) ? "IM" : " "); |
155 fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " "); | 171 fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " "); |
156 fprintf_filtered (file, " %s", (control & 0x0004) ? "ZM" : " "); | 172 fprintf_filtered (file, " %s", (control & 0x0004) ? "ZM" : " "); |
157 fprintf_filtered (file, " %s", (control & 0x0008) ? "OM" : " "); | 173 fprintf_filtered (file, " %s", (control & 0x0008) ? "OM" : " "); |
158 fprintf_filtered (file, " %s", (control & 0x0010) ? "UM" : " "); | 174 fprintf_filtered (file, " %s", (control & 0x0010) ? "UM" : " "); |
159 fprintf_filtered (file, " %s", (control & 0x0020) ? "PM" : " "); | 175 fprintf_filtered (file, " %s", (control & 0x0020) ? "PM" : " "); |
160 | 176 |
161 fputs_filtered ("\n", file); | 177 fputs_filtered ("\n", file); |
162 | 178 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 211 } |
196 } | 212 } |
197 | 213 |
198 /* Print out the i387 floating point state. Note that we ignore FRAME | 214 /* Print out the i387 floating point state. Note that we ignore FRAME |
199 in the code below. That's OK since floating-point registers are | 215 in the code below. That's OK since floating-point registers are |
200 never saved on the stack. */ | 216 never saved on the stack. */ |
201 | 217 |
202 void | 218 void |
203 i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, | 219 i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, |
204 struct frame_info *frame, const char *args) | 220 struct frame_info *frame, const char *args) |
error: old chunk mismatch |
None
OLD | NEW |