/* See language.h. */
+ bool can_print_type_offsets () const override
+ {
+ return true;
+ }
+
+ /* See language.h. */
+
void print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level,
const struct type_print_options *flags) const override
/* See language.h. */
+ bool can_print_type_offsets () const override
+ {
+ return true;
+ }
+
+ /* See language.h. */
+
void print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level,
const struct type_print_options *flags) const override
/* See language.h. */
+ bool can_print_type_offsets () const override
+ {
+ return true;
+ }
+
+ /* See language.h. */
+
void print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level,
const struct type_print_options *flags) const override
/* See language.h. */
+ bool can_print_type_offsets () const override
+ {
+ return true;
+ }
+
+ /* See language.h. */
+
void print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level,
const struct type_print_options *flags) const override
/* See language.h. */
+ bool can_print_type_offsets () const override
+ {
+ return true;
+ }
+
+ /* See language.h. */
+
void print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level,
const struct type_print_options *flags) const override
return nullptr;
}
+ /* Return true if this class' implementation of print_type can
+ handle the /o modifier. */
+ virtual bool can_print_type_offsets () const
+ {
+ return false;
+ }
+
/* Print TYPE to STREAM using syntax appropriate for this language.
LEVEL is the depth to indent lines by. VARSTRING, if not NULL or the
empty string, is the name of a variable and TYPE should be printed in
/* See language.h. */
+ bool can_print_type_offsets () const override
+ {
+ return true;
+ }
+
+ /* See language.h. */
+
void print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level,
const struct type_print_options *flags) const override
/* See language.h. */
+ bool can_print_type_offsets () const override
+ {
+ return true;
+ }
+
+ /* See language.h. */
+
void print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level,
const struct type_print_options *flags) const override
/* See language.h. */
+ bool can_print_type_offsets () const override
+ {
+ return true;
+ }
+
+ /* See language.h. */
+
void print_type (struct type *type, const char *varstring,
struct ui_file *stream, int show, int level,
const struct type_print_options *flags) const override;
# restore
gdb_test_no_output "set print type hex off"
}
+
+gdb_test_no_output "set language asm"
+gdb_test "ptype/o struct tuv" \
+ [string_to_regexp [multi_line \
+ "/* offset | size */ type = struct tuv \{" \
+ "/* 0 | 4 */ int a1;" \
+ "/* XXX 4-byte hole */" \
+ "/* 8 | 8 */ signed char *a2;" \
+ "/* 16 | 4 */ int a3;" \
+ "/* XXX 4-byte padding */" \
+ "" \
+ " /* total size (bytes): 24 */" \
+ " \}"]]
/* Filter out languages which don't implement the
feature. */
if (show > 0
- && (current_language->la_language == language_c
- || current_language->la_language == language_cplus
- || current_language->la_language == language_rust))
+ && current_language->can_print_type_offsets ())
{
flags.print_offsets = 1;
flags.print_typedefs = 0;