This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/2] Make names in gdbtypes.h,symtab.h const char *.
- From: Tom Tromey <tromey at redhat dot com>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 06 Feb 2012 11:58:23 -0700
- Subject: Re: [RFA 2/2] Make names in gdbtypes.h,symtab.h const char *.
- References: <20120202225218.BB5DD1E25BF@ruffy2.mtv.corp.google.com>
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> The changes to these two files involve a teensy bit of extra
Doug> work beyond simple mechanical changes.
Doug> This patch requires the main patch in
Doug> http://sourceware.org/ml/gdb-patches/2012-02/msg00043.html
FWIW this seems fine to me.
Doug> @@ -1455,10 +1455,11 @@ patch_type (struct type *type, struct ty
Doug> if (TYPE_NAME (real_target))
Doug> {
Doug> + /* The previous copy of TYPE_NAME is allocated by
Doug> + process_coff_symbol. */
Doug> if (TYPE_NAME (target))
Doug> - xfree (TYPE_NAME (target));
Doug> - TYPE_NAME (target) = concat (TYPE_NAME (real_target),
Doug> - (char *) NULL);
Doug> + xfree ((char*) TYPE_NAME (target));
Doug> + TYPE_NAME (target) = xstrdup (TYPE_NAME (real_target));
Doug> }
Doug> }
The old code here is pretty bad :(
Tom