X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fsymfile-mem.c;h=82fb17ed1654f7688fd75de0706b9ef38af3065e;hb=7190276c52b9d86a52aae73d3a0f8b56e7a1f4f1;hp=118f28987a311ffabcc067c7da8e927bde220706;hpb=a70b814420059e1f2de2130d532ddd7b2b2500fc;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c index 118f28987a..82fb17ed16 100644 --- a/gdb/symfile-mem.c +++ b/gdb/symfile-mem.c @@ -101,11 +101,9 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, /* Manage the new reference for the duration of this function. */ gdb_bfd_ref_ptr nbfd_holder = gdb_bfd_ref_ptr::new_reference (nbfd); - xfree (bfd_get_filename (nbfd)); if (name == NULL) - nbfd->filename = xstrdup ("shared object read from target memory"); - else - nbfd->filename = name; + name = xstrdup ("shared object read from target memory"); + bfd_set_filename (nbfd, name); if (!bfd_check_format (nbfd, bfd_object)) error (_("Got object file from memory but can't read symbols: %s."), @@ -113,9 +111,9 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, section_addr_info sai; for (sec = nbfd->sections; sec != NULL; sec = sec->next) - if ((bfd_get_section_flags (nbfd, sec) & (SEC_ALLOC|SEC_LOAD)) != 0) - sai.emplace_back (bfd_get_section_vma (nbfd, sec) + loadbase, - bfd_get_section_name (nbfd, sec), + if ((bfd_section_flags (sec) & (SEC_ALLOC|SEC_LOAD)) != 0) + sai.emplace_back (bfd_section_vma (sec) + loadbase, + bfd_section_name (sec), sec->index); if (from_tty) @@ -198,7 +196,7 @@ add_vsyscall_page (struct target_ops *target, int from_tty) name, 0 /* from_tty */); } - catch (const gdb_exception_RETURN_MASK_ALL &ex) + catch (const gdb_exception &ex) { exception_print (gdb_stderr, ex); }