This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Revised display-linkage-name
- From: Tom Tromey <tromey at redhat dot com>
- To: Michael Eager <eager at eagerm dot com>
- Cc: Keith Seitz <keiths at redhat dot com>, "gdb-patches\ at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Thu, 01 Aug 2013 14:55:52 -0600
- Subject: Re: [PATCH] Revised display-linkage-name
- References: <519D086A dot 50105 at eagerm dot com> <51BF47DB dot 6070709 at eagerm dot com> <51DD891D dot 7090009 at eagerm dot com> <51DF3F97 dot 90805 at redhat dot com> <51E07263 dot 6080605 at eagerm dot com> <51E6E797 dot 30709 at eagerm dot com> <51ED705A dot 5000601 at redhat dot com> <51ED90E3 dot 30801 at eagerm dot com> <51EDAA3A dot 5090504 at redhat dot com> <51EFF8F8 dot 6050807 at eagerm dot com> <874nbhtb80 dot fsf at fleche dot redhat dot com> <51F2D975 dot 3060801 at eagerm dot com> <87bo5lp895 dot fsf at fleche dot redhat dot com> <51FAB8BC dot 2060108 at eagerm dot com>
>>>>> "Michael" == Michael Eager <eager@eagerm.com> writes:
Michael> I eliminated the annotations and made the other requested changes.
Michael> + if (strlen (SYMBOL_LINKAGE_NAME (msymbol.minsym))
Michael> + > display_linkage_name_length)
Michael> + {
I think this should also check ui_out_is_mi_like_p.
Michael> + /* Print linkage name after source name if requested and different. */
Michael> + if ((display_linkage_name || ui_out_is_mi_like_p (uiout))
Michael> + && linkname != NULL && strcmp (funname, linkname) != 0)
Michael> + {
Michael> + ui_out_text (uiout, " [");
Michael> +
Michael> + if (strlen (linkname) > display_linkage_name_length)
Michael> + {
Here too.
Michael> + char *lname = alloca (display_linkage_name_length + 4);
Michael> +
Michael> + strncpy (lname, linkname, display_linkage_name_length);
Michael> + lname[display_linkage_name_length] = '\0';
Michael> + strcat (lname, "...");
Michael> + ui_out_text (uiout, lname);
Here you emit it as text...
Michael> + }
Michael> + else
Michael> + ui_out_field_string (uiout, "linkage name", linkname);
... here with a field name with spaces...
Michael> +
Michael> + ui_out_text (uiout, "]");
Michael> + ui_out_field_stream (uiout, "linkage_name", stb);
... and here with an underscore. Another part of the patch used
"linkage-name", with a hyphen. I think the hyphen one should be
preferred.
Also, this last bit looks the same as an earlier revision to me.
"stb" simply isn't valid here -- your code isn't printing to it, it was
set up earlier; I'm surprised it is even still live.
Tom