* Patch to fix crash on mingw and nil-typenames.
@ 2011-10-12 8:35 Joost van der Sluis
2011-10-12 13:45 ` Tom Tromey
2011-10-12 14:42 ` Yao Qi
0 siblings, 2 replies; 5+ messages in thread
From: Joost van der Sluis @ 2011-10-12 8:35 UTC (permalink / raw)
To: gdb-patches
Hi all,
This patch resolves crashes of gdb on mingw, because fprintf on mingw
does not substitute nil-string parameters.
2011-10-12 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.
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1220,6 +1220,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) \
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Patch to fix crash on mingw and nil-typenames.
2011-10-12 8:35 Patch to fix crash on mingw and nil-typenames Joost van der Sluis
@ 2011-10-12 13:45 ` Tom Tromey
2011-10-12 14:42 ` Yao Qi
1 sibling, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2011-10-12 13:45 UTC (permalink / raw)
To: Joost van der Sluis; +Cc: gdb-patches
>>>>> "Joost" == Joost van der Sluis <joost@cnoc.nl> writes:
Joost> 2011-10-12 Joost van der Sluis <joost@cnoc.nl>
Joost> * gdbtypes.h Added TYPE_SAFE_NAME macro to get the name of a
Joost> type or "<unnamed type"> when there is no name assigned.
Joost> * gnu-v3-abi.c (gnuv3_rtti_type): Use TYPE_SAFE_NAME macro to
Joost> avoid a sigint when no name is assigned.
This is ok.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Patch to fix crash on mingw and nil-typenames.
2011-10-12 8:35 Patch to fix crash on mingw and nil-typenames Joost van der Sluis
2011-10-12 13:45 ` Tom Tromey
@ 2011-10-12 14:42 ` Yao Qi
2011-10-12 15:51 ` Joost van der Sluis
1 sibling, 1 reply; 5+ messages in thread
From: Yao Qi @ 2011-10-12 14:42 UTC (permalink / raw)
To: gdb-patches
On 10/12/2011 04:35 PM, Joost van der Sluis wrote:
> 2011-10-12 Joost van der Sluis <joost@cnoc.nl>
>
> * gdbtypes.h Added TYPE_SAFE_NAME macro to get the name of a
^ Please add a ":" here.
> type or "<unnamed type"> when there is no name assigned.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Patch to fix crash on mingw and nil-typenames.
2011-10-12 14:42 ` Yao Qi
@ 2011-10-12 15:51 ` Joost van der Sluis
2011-10-14 19:53 ` Tom Tromey
0 siblings, 1 reply; 5+ messages in thread
From: Joost van der Sluis @ 2011-10-12 15:51 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
On Wed, 2011-10-12 at 22:41 +0800, Yao Qi wrote:
> On 10/12/2011 04:35 PM, Joost van der Sluis wrote:
> > 2011-10-12 Joost van der Sluis <joost@cnoc.nl>
> >
> > * gdbtypes.h Added TYPE_SAFE_NAME macro to get the name of a
> ^ Please add a ":" here.
Yes, sorry for the mistake. I don't think I have to re-send it, but that
when it is committed, the person who does this can change this, no?
Joost van der Sluis.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Patch to fix crash on mingw and nil-typenames.
2011-10-12 15:51 ` Joost van der Sluis
@ 2011-10-14 19:53 ` Tom Tromey
0 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2011-10-14 19:53 UTC (permalink / raw)
To: Joost van der Sluis; +Cc: Yao Qi, gdb-patches
>>>>> "Joost" == Joost van der Sluis <joost@cnoc.nl> writes:
Joost> Yes, sorry for the mistake. I don't think I have to re-send it, but that
Joost> when it is committed, the person who does this can change this, no?
I'm fixing this and checking it in.
In the future you'll need an assignment in place and have to get
write-after-approval access. If you plan to hack more on gdb, and don't
have papers in place (I don't know) then contact me off-list to get
started.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-14 19:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-12 8:35 Patch to fix crash on mingw and nil-typenames Joost van der Sluis
2011-10-12 13:45 ` Tom Tromey
2011-10-12 14:42 ` Yao Qi
2011-10-12 15:51 ` Joost van der Sluis
2011-10-14 19:53 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox