]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2011-10-17 Joost van der Sluis <joost@cnoc.nl>
authorTom Tromey <tromey@redhat.com>
Mon, 17 Oct 2011 14:04:37 +0000 (14:04 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 17 Oct 2011 14:04:37 +0000 (14:04 +0000)
* gdbtypes.h: Added TYPE_SAFE_NAME macro to get the name of a
type or "<unnamed type"> when there is no name assigned.
* gnu-v3-abi.c (gnuv3_rtti_type): Use TYPE_SAFE_NAME macro to
avoid a sigint when no name is assigned.

gdb/ChangeLog
gdb/gdbtypes.h
gdb/gnu-v3-abi.c

index ff1b729d049e39cf31ced803afdc702eede9c570..6862c260d9261425fed5f2352dad6bd57853fddc 100644 (file)
@@ -1,3 +1,10 @@
+2011-10-17  Joost van der Sluis  <joost@cnoc.nl>
+
+       * gdbtypes.h: Added TYPE_SAFE_NAME macro to get the name of a
+       type or "<unnamed type"> when there is no name assigned.
+       * gnu-v3-abi.c (gnuv3_rtti_type): Use TYPE_SAFE_NAME macro to
+       avoid a sigint when no name is assigned.
+
 2011-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Revert:
index e6ed7ac10fc8d9e3ce9c78c3712621f26dceffbc..69f6b46f00d589763e9d92155418d00c72d0dd49 100644 (file)
@@ -1204,6 +1204,11 @@ extern void allocate_gnat_aux_type (struct type *);
        || TYPE_NFN_FIELDS (thistype) == 0) \
    && (TYPE_STUB (thistype) || !TYPE_STUB_SUPPORTED (thistype)))
 
+/* A helper macro that returns the name of a type or "unnamed type" if the type
+   has no name.  */
+#define TYPE_SAFE_NAME(type) \
+  (TYPE_NAME (type) ? TYPE_NAME (type) : _("<unnamed type>"))
+
 /* A helper macro that returns the name of an error type.  If the type
    has a name, it is used; otherwise, a default is used.  */
 #define TYPE_ERROR_NAME(type) \
index 6c6f92ce06e8e25ac07ca7af171121fc17c91158..92b73d38472a82bbf07b376b6e36e7ba94be7800 100644 (file)
@@ -319,7 +319,7 @@ gnuv3_rtti_type (struct value *value,
       || strncmp (vtable_symbol_name, "vtable for ", 11))
     {
       warning (_("can't find linker symbol for virtual table for `%s' value"),
-              TYPE_NAME (values_type));
+              TYPE_SAFE_NAME (values_type));
       if (vtable_symbol_name)
        warning (_("  found `%s' instead"), vtable_symbol_name);
       return NULL;