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: [PATCH] Remove gdb_bfd_stash_filename to fix crash with fix of binutils/11983


>>>>> "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


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