From: Tom de Vries Date: Wed, 11 Feb 2026 15:07:39 +0000 (+0100) Subject: [gdb/build] Add debug_type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=136ca533234bb979896479cc3bcc466c3128728f;p=thirdparty%2Fbinutils-gdb.git [gdb/build] Add debug_type Add debug_type, similar to debug_val and debug_exp: ... (gdb) call debug_type (type) array (1 .. 4) of character(gdb) ... Approved-By: Tom Tromey --- diff --git a/gdb/typeprint.c b/gdb/typeprint.c index 457dfc23214..e53a2b21af5 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -515,6 +515,18 @@ ptype_command (const char *type_name, int from_tty) whatis_exp (type_name, 1); } +/* Meant to be used in debug sessions, so don't export it in a header file. */ +extern void ATTRIBUTE_UNUSED debug_type (struct type *type); + +/* Print TYPE. */ + +void ATTRIBUTE_UNUSED +debug_type (struct type *type) +{ + type_print (type, "", gdb_stdlog, 1); + gdb_flush (gdb_stdlog); +} + /* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM. Used to print data from type structures in a specified type. For example, array bounds may be characters or booleans in some languages, and this