diff options
author | Tom Tromey <tromey@redhat.com> | 2011-10-17 14:04:35 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-10-17 14:04:35 +0000 |
commit | c4de996e7ff7a6271a287041a54a66916dfb81a1 (patch) | |
tree | 60f7697b85350406af84d1095b0c214e4ef87235 /gdb/gdbtypes.h | |
parent | d38bb22fd7dc3f68157654560971b253d2cdd9d1 (diff) | |
download | gdb-c4de996e7ff7a6271a287041a54a66916dfb81a1.tar.gz |
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.
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r-- | gdb/gdbtypes.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index e6ed7ac10fc..69f6b46f00d 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -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) \ |