From: Tom Tromey <tromey@redhat.com>
To: Hui Zhu <hui_zhu@mentor.com>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>,
gdb-patches ml <gdb-patches@sourceware.org>,
Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>,
Nick Clifton <nickc@redhat.com>
Subject: Re: [PATCH] Remove gdb_bfd_stash_filename to fix crash with fix of binutils/11983
Date: Mon, 06 Jan 2014 08:25:00 -0000 [thread overview]
Message-ID: <87k3edseia.fsf@fleche.redhat.com> (raw)
In-Reply-To: <52C97EC0.3080807@mentor.com> (Hui Zhu's message of "Sun, 5 Jan 2014 23:48:16 +0800")
>>>>> "Hui" == Hui Zhu <hui_zhu@mentor.com> writes:
Hui> Thanks. Post a new version.
Thanks Hui. This is definitely the direction I think the code should
go.
Hui> --- a/gdb/symfile-mem.c
Hui> +++ b/gdb/symfile-mem.c
Hui> @@ -104,11 +104,7 @@ symbol_file_add_from_memory (struct bfd
Hui> if (name == NULL)
Hui> nbfd-> filename = "shared object read from target memory";
Hui> else
Hui> - {
Hui> - nbfd->filename = name;
Hui> - gdb_bfd_stash_filename (nbfd);
Hui> - xfree (name);
Hui> - }
Hui> + nbfd->filename = name;
Hui> cleanup = make_cleanup_bfd_unref (nbfd);
In this hunk there are two things to note.
First, there is an earlier assignment to filename (in the context above)
that should use xstrdup.
Second, the new assignment really ought to free the old nbfd->filename
first.
There are also some assignments that must be fixed that do not use
gdb_bfd_stash_filename:
solib-aix.c:solib_aix_bfd_open
solib-darwin.c:darwin_bfd_open
solib-spu.c:spu_bfd_open
spu-linux-nat.c:spu_bfd_open
If you don't get to this soon, no worries, I will add these to your
patch tomorrow morning and check it in.
Tom
next prev parent reply other threads:[~2014-01-06 8:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-04 16:23 Hui Zhu
2014-01-05 15:06 ` Sergio Durigan Junior
2014-01-05 15:48 ` Hui Zhu
2014-01-06 8:25 ` Tom Tromey [this message]
2014-01-06 10:50 ` Hui Zhu
2014-01-06 16:14 ` Tom Tromey
2014-01-06 17:12 ` Doug Evans
2014-01-06 21:07 ` Tom Tromey
2014-01-07 12:35 ` Pedro Alves
2014-01-07 13:55 ` Pedro Alves
2014-01-07 17:41 ` Tom Tromey
2014-01-07 19:54 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k3edseia.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=emachado@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=hui_zhu@mentor.com \
--cc=nickc@redhat.com \
--cc=sergiodj@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox