From 97e20099d3b02baafe244e975aebe09020d2ab34 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 7 Nov 2022 11:12:35 -0700 Subject: Allow 'ptype/o' for assembly PR exp/28359 points out that 'ptype/o' does not work when the current language is "asm". I tracked this down to a hard-coded list of languages in typeprint.c. This patch replaces this list with a method on 'language_defn' instead. If all languages are ever updated to have this feature, the method could be removed; but in the meantime this lets each language control what happens. I looked at having each print_type method simply modify the flags itself, but this doesn't work very well with the feature that disables method-printing by default (but allows it via a flag). Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28359 Approved-By: Andrew Burgess Approved-By: Keith Seitz --- gdb/objc-lang.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gdb/objc-lang.c') diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 1a1d621..3c2cbf4 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -266,6 +266,13 @@ public: /* 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 -- cgit v1.1