Re: [PATCH 2/2] gdb: pass type name directly to arch_composite_type

Tom Tromey <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
>>>>> "Simon" == Simon Marchi <[email protected]> writes:

Simon> First, it's not necessary to duplicate the string, we can pass the
Simon> literal string directly, and its lifetime will be appropriate.  Second,
Simon> we can pass the name directly to arch_composite_type, instead of doing a
Simon> separate set_name call.  So, replace the above with:

Simon>   sigval_type = arch_composite_type (gdbarch, "sigval", TYPE_CODE_UNION);

Thanks.  One tiny nit below.

Simon>    /* sival_t */
Simon> -  type *sigval_union_type = arch_composite_type (gdbarch, nullptr,
Simon> +  type *sigval_union_type = arch_composite_type (gdbarch, "sigval_t",
Simon>  						 TYPE_CODE_UNION);

The comment says "sival_t" but the type says "sigval_t".
The Linux headers say the latter, so the comment is wrong.

Personally I think this comment isn't so useful and could be removed,
but fixing it would also be fine.

Approved-By: Tom Tromey <[email protected]>

Tom
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.