(builtin_type_true_unsigned_char): Likewise.
(struct builtin_type): Add builtin_true_char and
builtin_true_unsigned_char members.
* gdbtypes.c (builtin_type_true_char): Remove.
(builtin_type_true_unsigned_char): Likewise.
(_initialize_gdbtypes): Do not initialize them.
(gdbtypes_post_init): Initialize builtin_true_char and
builtin_true_unsigned_char members of builtin_type.
* printcmd.c (print_scalar_formatted): Use builtin_type
members instead of builtin_type_true_char and
builtin_type_true_unsigned_char.
* ada-valprint.c (ada_val_print_1): Likewise.
2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+ * gdbtypes.h (builtin_type_true_char): Remove.
+ (builtin_type_true_unsigned_char): Likewise.
+ (struct builtin_type): Add builtin_true_char and
+ builtin_true_unsigned_char members.
+ * gdbtypes.c (builtin_type_true_char): Remove.
+ (builtin_type_true_unsigned_char): Likewise.
+ (_initialize_gdbtypes): Do not initialize them.
+ (gdbtypes_post_init): Initialize builtin_true_char and
+ builtin_true_unsigned_char members of builtin_type.
+
+ * printcmd.c (print_scalar_formatted): Use builtin_type
+ members instead of builtin_type_true_char and
+ builtin_type_true_unsigned_char.
+ * ada-valprint.c (ada_val_print_1): Likewise.
+
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
* gdbtypes.h (builtin_type_void): Remove.
* gdbtypes.c (builtin_type_void): Remove.
(_initialize_gdbtypes): Do not initialize it.
struct value *func = ada_vax_float_print_function (type);
if (func != 0)
{
+ struct gdbarch *gdbarch = current_gdbarch;
CORE_ADDR addr;
addr = value_as_address (call_function_by_hand (func, 1, &val));
- val_print_string (builtin_type_true_char,
+ val_print_string (builtin_type (gdbarch)->builtin_true_char,
addr, -1, stream, options);
return 0;
}
struct type *builtin_type_ia64_spill;
struct type *builtin_type_ia64_quad;
-/* Platform-neutral character types. */
-struct type *builtin_type_true_char;
-struct type *builtin_type_true_unsigned_char;
-
-
int opaque_type_resolution = 1;
static void
show_opaque_type_resolution (struct ui_file *file, int from_tty,
0,
"_Decimal128", (struct objfile *) NULL);
+ /* "True" character types. */
+ builtin_type->builtin_true_char =
+ init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0,
+ "true character", (struct objfile *) NULL);
+ builtin_type->builtin_true_unsigned_char =
+ init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED,
+ "true character", (struct objfile *) NULL);
+
/* Default data/code pointer types. */
builtin_type->builtin_data_ptr =
make_pointer_type (builtin_type->builtin_void, NULL);
builtin_type_ia64_quad =
build_flt (-1, "builtin_type_ia64_quad", floatformats_ia64_quad);
- builtin_type_true_char =
- init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
- "true character", (struct objfile *) NULL);
- builtin_type_true_unsigned_char =
- init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "true character", (struct objfile *) NULL);
-
add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, _("\
Set debugging of C++ overloading."), _("\
Show debugging of C++ overloading."), _("\
struct type *builtin_decdouble;
struct type *builtin_declong;
+ /* "True" character types.
+ We use these for the '/c' print format, because c_char is just a
+ one-byte integral type, which languages less laid back than C
+ will print as ... well, a one-byte integral type. */
+ struct type *builtin_true_char;
+ struct type *builtin_true_unsigned_char;
+
/* Pointer types. */
extern struct type *builtin_type_ia64_quad;
-/* Platform-neutral character types.
- We use these for the '/c' print format, because c_char is just a
- one-byte integral type, which languages less laid back than C
- will print as ... well, a one-byte integral type. */
-extern struct type *builtin_type_true_char;
-extern struct type *builtin_type_true_unsigned_char;
-
-
/* Maximum and minimum values of built-in types */
#define MAX_OF_TYPE(t) \
const struct value_print_options *options,
int size, struct ui_file *stream)
{
+ struct gdbarch *gdbarch = current_gdbarch;
LONGEST val_long = 0;
unsigned int len = TYPE_LENGTH (type);
- enum bfd_endian byte_order = gdbarch_byte_order (current_gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* If we get here with a string format, try again without it. Go
all the way back to the language printers, which may call us
same, then at this point, the value's length (in target bytes) is
gdbarch_addr_bit/TARGET_CHAR_BIT, not TYPE_LENGTH (type). */
if (TYPE_CODE (type) == TYPE_CODE_PTR)
- len = gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT;
+ len = gdbarch_addr_bit (gdbarch) / TARGET_CHAR_BIT;
/* If we are printing it as unsigned, truncate it in case it is actually
a negative signed value (e.g. "print/u (short)-1" should print 65535
{
struct value_print_options opts = *options;
opts.format = 0;
+
if (TYPE_UNSIGNED (type))
- value_print (value_from_longest (builtin_type_true_unsigned_char,
- val_long),
- stream, &opts);
- else
- value_print (value_from_longest (builtin_type_true_char, val_long),
- stream, &opts);
+ type = builtin_type (gdbarch)->builtin_true_unsigned_char;
+ else
+ type = builtin_type (gdbarch)->builtin_true_char;
+
+ value_print (value_from_longest (type, val_long), stream, &opts);
}
break;