]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/build] Add debug_type
authorTom de Vries <tdevries@suse.de>
Wed, 11 Feb 2026 15:07:39 +0000 (16:07 +0100)
committerTom de Vries <tdevries@suse.de>
Wed, 11 Feb 2026 15:07:39 +0000 (16:07 +0100)
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 <tom@tromey.com>
gdb/typeprint.c

index 457dfc23214cd4579540ca73bd8d30e2c561fe45..e53a2b21af5c605dbb0d815e01495387206c2786 100644 (file)
@@ -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