mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 18:08:24 +08:00
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 <aburgess@redhat.com> Approved-By: Keith Seitz <keiths@redhat.com>
This commit is contained in:
@ -451,6 +451,13 @@ struct language_defn
|
||||
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
|
||||
|
Reference in New Issue
Block a user