This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 3/4] Remove TYPE_TAG_NAME


On 04/18/2018 10:57 AM, Tom Tromey wrote:
>>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
> 
>>> +      /* If we have "typedef struct foo {. . .} bar;" do we want to
>>> +	 print it as "struct foo" or as "bar"?  Pick the latter for
>>> +	 C++, because C++ folk tend to expect things like "class5
>>> +	 *foo" rather than "struct class5 *foo".  */
>>> +      if (language == language_c || language == language_minimal)
> 
> Keith> I'm almost afraid to ask, but why was language_minimal necessary here?
> Keith> A small comment might be appropriate?
> Keith> [I think I can already guess the heinous reason...] Do you know if
> Keith> there is a test case that specifically covers this block with
> Keith> language_minimal?
> 
> I think in this case, I added language_minimal on the theory that it is
> "C-like".  I don't think there's a test case.
> 
> I can add a comment, and a test case wouldn't be too hard either.

Seeing "language_minimal" caught me off guard. A comment would more than satisfy me.

> 
>>> gdb_test "ptype \$structreg" \
>>> "type = struct struct1 {\r\n *v4int8 v4;\r\n *v2int16 v2;\r\n}"
> 
> Keith> <rhetorical>Was the tag name never printed until now?</rhetorical> Wow!
> 
> Maybe I should have investigated this one more deeply?
> I dunno.  The change seemed to make sense to me so I just moved on.

I agree. My rhetorical "question" was really more a statement of disbelief. Things like this seem to catch me by surprise every so often -- sometimes more often than not.

Keith


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]