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] |
On 2017-08-04 22:28, Simon Marchi wrote:
On 2017-08-04 19:13, Tom Tromey wrote:Simon> There is still a cleanup in reload_shared_libraries_1, so I don'tSimon> think the do_cleanups should be removed. Ugh, sorry about that. That code is duplicating the bfd's file name. But I can't see why that's important. I think just removing the xstrdup and the make_cleanup is the right thing to do here. What do you think? TomI don't see any reason either. Simon
Actually, if we look at the code before you introduced gdb_bfd_ref_ptr, the lifetime of abfd was shorter than the required lifetime of the string. Since freeing the bfd frees the name internally, one option was to make a copy. With gdb_bfd_ref_ptr, the lifetime of abfd is long enough that we don't need the copy.
Simon
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |