2013-09-24 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Code cleanup: Add objfile_name accessor function.
+ * ada-lang.c (is_known_support_routine): Use objfile_name.
+ * auto-load.c (source_gdb_script_for_objfile)
+ (auto_load_objfile_script): Likewise.
+ * coffread.c (coff_symtab_read, read_one_sym): Likewise.
+ * dbxread.c (dbx_symfile_read): Likewise.
+ * dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
+ * dwarf2loc.c (locexpr_describe_location_piece): Likewise.
+ * dwarf2read.c (dwarf2_get_dwz_file, dwarf2_read_index)
+ (dw2_symtab_iter_next, dw2_expand_symtabs_matching)
+ (lookup_dwp_signatured_type, lookup_dwo_unit)
+ (dwarf2_build_psymtabs_hard, scan_partial_symbols, process_queue)
+ (fixup_go_packaging, process_imported_unit_die, dwarf2_physname)
+ (read_import_statement, create_dwo_cu, open_and_init_dwp_file)
+ (lookup_dwo_cutu, read_call_site_scope, dwarf2_ranges_read)
+ (dwarf2_record_block_ranges, read_common_block, read_typedef)
+ (read_subrange_type, load_partial_dies, read_partial_die)
+ (read_addr_index_1, read_str_index, dwarf_decode_lines_1)
+ (die_containing_type, build_error_marker_type, lookup_die_type)
+ (follow_die_ref_or_sig, follow_die_ref, dwarf2_fetch_die_loc_sect_off)
+ (dwarf2_fetch_constant_bytes, follow_die_sig, get_signatured_type)
+ (get_DW_AT_signature_type, write_psymtabs_to_index)
+ (save_gdb_index_command): Likewise.
+ * elfread.c (find_separate_debug_file_by_buildid, elf_symfile_read):
+ Likewise.
+ * expprint.c (dump_subexp_body_standard): Likewise.
+ * gdbtypes.c (type_name_no_tag_or_error): Likewise.
+ * jit.c (jit_object_close_impl): Use the objfile field name renamed to
+ original_name.
+ * linux-thread-db.c (try_thread_db_load_from_pdir_1): New variable
+ obj_name, use objfile_name for it, use the variable.
+ (try_thread_db_load_from_pdir, has_libpthread, thread_db_new_objfile):
+ Use objfile_name.
+ * machoread.c (macho_symtab_read, macho_check_dsym)
+ (macho_symfile_relocate): Likewise.
+ * maint.c (maintenance_translate_address): Likewise.
+ * minidebug.c (find_separate_debug_file_in_section): Likewise.
+ * minsyms.c (install_minimal_symbols): Likewise.
+ * objfiles.c (allocate_objfile): Use the objfile field name renamed to
+ original_name.
+ (filter_overlapping_sections): Use objfile_name.
+ (objfile_name): New function.
+ * objfiles.h (struct objfile): Rename field name to original_name.
+ (objfile_name): New prototype.
+ * printcmd.c (sym_info, address_info): Use objfile_name.
+ * probe.c (parse_probes, collect_probes, compare_probes)
+ (info_probes_for_ops): Likewise.
+ * progspace.c (clone_program_space): Likewise.
+ * psymtab.c (require_partial_symbols, dump_psymtab, allocate_psymtab)
+ (maintenance_info_psymtabs): Likewise.
+ * python/py-auto-load.c (gdbpy_load_auto_script_for_objfile)
+ (source_section_scripts): Likewise.
+ * python/py-objfile.c (objfpy_get_filename): Likewise.
+ * python/py-progspace.c (pspy_get_filename): Likewise.
+ * solib-aix.c (solib_aix_get_toc_value): Likewise.
+ * solib-som.c (match_main, som_solib_section_offsets): Likewise.
+ * solib.c (solib_read_symbols): Likewise.
+ * stabsread.c (scan_file_globals): Likewise.
+ * stap-probe.c (handle_stap_probe): Likewise.
+ * symfile.c (symbol_file_clear, separate_debug_file_exists)
+ (find_separate_debug_file_by_debuglink): Likewise.
+ (reread_symbols): Likewise. Use the objfile field name renamed to
+ original_name.
+ (allocate_symtab): Use objfile_name.
+ * symmisc.c (print_symbol_bcache_statistics, print_objfile_statistics)
+ (dump_objfile, dump_msymbols, dump_symtab_1)
+ (maintenance_print_msymbols, maintenance_print_objfiles)
+ (maintenance_info_symtabs, maintenance_check_symtabs): Likewise.
+ * target.c (target_translate_tls_address, target_info): Likewise.
+ * xcoffread.c (xcoff_initial_scan): Make variable name const. Use
+ objfile_name.
+
+2013-09-24 Jan Kratochvil <jan.kratochvil@redhat.com>
+
Code cleanup.
* probe.c (parse_probes): Rename variable objfile_name to
objfile_namestr.
if (re_exec (lbasename (sal.symtab->filename)))
return 1;
if (sal.symtab->objfile != NULL
- && re_exec (sal.symtab->objfile->name))
+ && re_exec (objfile_name (sal.symtab->objfile)))
return 1;
}
is_safe = file_is_auto_load_safe (filename, _("auto-load: Loading canned "
"sequences of commands script "
"\"%s\" for objfile \"%s\".\n"),
- filename, objfile->name);
+ filename, objfile_name (objfile));
/* Add this script to the hash table too so "info auto-load gdb-scripts"
can print it. */
auto_load_objfile_script (struct objfile *objfile,
const struct script_language *language)
{
- char *realname = gdb_realpath (objfile->name);
+ char *realname = gdb_realpath (objfile_name (objfile));
struct cleanup *cleanups = make_cleanup (xfree, realname);
if (!auto_load_objfile_script_1 (objfile, realname, language))
/* Position to read the symbol table. */
val = bfd_seek (objfile->obfd, (long) symtab_offset, 0);
if (val < 0)
- perror_with_name (objfile->name);
+ perror_with_name (objfile_name (objfile));
coffread_objfile = objfile;
nlist_bfd_global = objfile->obfd;
cs->c_symnum = symnum;
bytes = bfd_bread (temp_sym, local_symesz, nlist_bfd_global);
if (bytes != local_symesz)
- error (_("%s: error reading symbols"), coffread_objfile->name);
+ error (_("%s: error reading symbols"), objfile_name (coffread_objfile));
bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *) sym);
cs->c_naux = sym->n_numaux & 0xff;
if (cs->c_naux >= 1)
{
bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
if (bytes != local_auxesz)
- error (_("%s: error reading symbols"), coffread_objfile->name);
+ error (_("%s: error reading symbols"), objfile_name (coffread_objfile));
bfd_coff_swap_aux_in (symfile_bfd, temp_aux,
sym->n_type, sym->n_sclass,
0, cs->c_naux, (char *) aux);
{
bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
if (bytes != local_auxesz)
- error (_("%s: error reading symbols"), coffread_objfile->name);
+ error (_("%s: error reading symbols"),
+ objfile_name (coffread_objfile));
}
}
cs->c_name = getsymname (sym);
val = bfd_seek (sym_bfd, DBX_SYMTAB_OFFSET (objfile), SEEK_SET);
if (val < 0)
- perror_with_name (objfile->name);
+ perror_with_name (objfile_name (objfile));
/* Size the symbol table. */
if (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)
if (e.reason < 0)
{
warning (_("skipping .eh_frame info of %s: %s"),
- objfile->name, e.message);
+ objfile_name (objfile), e.message);
if (fde_table.num_entries != 0)
{
if (e.reason < 0)
{
warning (_("skipping .debug_frame info of %s: %s"),
- objfile->name, e.message);
+ objfile_name (objfile), e.message);
if (fde_table.num_entries != 0)
{
fprintf_filtered (stream,
_("a thread-local variable at offset 0x%s "
"in the thread-local storage for `%s'"),
- phex_nz (offset, addr_size), objfile->name);
+ phex_nz (offset, addr_size), objfile_name (objfile));
data += 1 + addr_size + 1;
}
fprintf_filtered (stream,
_("a thread-local variable at offset 0x%s "
"in the thread-local storage for `%s'"),
- phex_nz (offset, addr_size), objfile->name);
+ phex_nz (offset, addr_size), objfile_name (objfile));
++data;
}
filename = (const char *) data;
if (!IS_ABSOLUTE_PATH (filename))
{
- char *abs = gdb_realpath (dwarf2_per_objfile->objfile->name);
+ char *abs = gdb_realpath (objfile_name (dwarf2_per_objfile->objfile));
char *rel;
make_cleanup (xfree, abs);
offset_type cu_list_elements, types_list_elements, dwz_list_elements = 0;
struct dwz_file *dwz;
- if (!read_index_from_section (objfile, objfile->name,
+ if (!read_index_from_section (objfile, objfile_name (objfile),
use_deprecated_index_sections,
&dwarf2_per_objfile->gdb_index, &local_map,
&cu_list, &cu_list_elements,
{
complaint (&symfile_complaints,
_(".gdb_index entry has bad CU index"
- " [in module %s]"), dwarf2_per_objfile->objfile->name);
+ " [in module %s]"),
+ objfile_name (dwarf2_per_objfile->objfile));
continue;
}
{
complaint (&symfile_complaints,
_(".gdb_index entry has bad CU index"
- " [in module %s]"), objfile->name);
+ " [in module %s]"), objfile_name (objfile));
continue;
}
hex_string (sig),
cu->per_cu->is_debug_types ? "TU" : "CU",
cu->per_cu->offset.sect_off,
- objfile->name);
+ objfile_name (objfile));
return sig_entry;
}
if (! attr)
error (_("Dwarf Error: missing dwo_id for dwo_name %s"
" [in module %s]"),
- dwo_name, this_cu->objfile->name);
+ dwo_name, objfile_name (this_cu->objfile));
signature = DW_UNSND (attr);
dwo_unit = lookup_dwo_comp_unit (this_cu, dwo_name, comp_dir,
signature);
if (dwarf2_read_debug)
{
fprintf_unfiltered (gdb_stdlog, "Building psymtabs of objfile %s ...\n",
- objfile->name);
+ objfile_name (objfile));
}
dwarf2_per_objfile->reading_partial_symbols = 1;
if (dwarf2_read_debug)
fprintf_unfiltered (gdb_stdlog, "Done building psymtabs of %s\n",
- objfile->name);
+ objfile_name (objfile));
}
/* die_reader_func for load_partial_comp_unit. */
{
error (_("Dwarf Error: DW_TAG_imported_unit is not"
" supported in type units [in module %s]"),
- cu->objfile->name);
+ objfile_name (cu->objfile));
}
per_cu = dwarf2_find_containing_comp_unit (pdi->d.offset,
{
fprintf_unfiltered (gdb_stdlog,
"Expanding one or more symtabs of objfile %s ...\n",
- dwarf2_per_objfile->objfile->name);
+ objfile_name (dwarf2_per_objfile->objfile));
}
/* The queue starts out with one item, but following a DIE reference
if (dwarf2_read_debug)
{
fprintf_unfiltered (gdb_stdlog, "Done expanding symtabs of %s.\n",
- dwarf2_per_objfile->objfile->name);
+ objfile_name (dwarf2_per_objfile->objfile));
}
}
_("Symtab %s has objects from two different Go packages: %s and %s"),
(SYMBOL_SYMTAB (sym)
? symtab_to_filename_for_display (SYMBOL_SYMTAB (sym))
- : cu->objfile->name),
+ : objfile_name (cu->objfile)),
this_package_name, package_name);
xfree (this_package_name);
}
{
error (_("Dwarf Error: DW_TAG_imported_unit is not"
" supported in type units [in module %s]"),
- cu->objfile->name);
+ objfile_name (cu->objfile));
}
attr = dwarf2_attr (die, DW_AT_import, cu);
complaint (&symfile_complaints,
_("Computed physname <%s> does not match demangled <%s> "
"(from linkage <%s>) - DIE at 0x%x [in module %s]"),
- physname, canon, mangled, die->offset.sect_off, objfile->name);
+ physname, canon, mangled, die->offset.sect_off,
+ objfile_name (objfile));
/* Prefer DW_AT_linkage_name (in the CANON form) - when it
is available here - over computed PHYSNAME. It is safer
complaint (&symfile_complaints,
_("child DW_TAG_imported_declaration expected "
"- DIE at 0x%x [in module %s]"),
- child_die->offset.sect_off, objfile->name);
+ child_die->offset.sect_off, objfile_name (objfile));
continue;
}
complaint (&symfile_complaints,
_("child DW_TAG_imported_declaration has unknown "
"imported name - DIE at 0x%x [in module %s]"),
- child_die->offset.sect_off, objfile->name);
+ child_die->offset.sect_off, objfile_name (objfile));
continue;
}
{
complaint (&symfile_complaints,
_("Multiple CUs in DWO file %s [in module %s]"),
- dwo_file->dwo_name, objfile->name);
+ dwo_file->dwo_name, objfile_name (objfile));
break;
}
bfd *dbfd;
struct cleanup *cleanups;
- dwp_name = xstrprintf ("%s.dwp", dwarf2_per_objfile->objfile->name);
+ dwp_name = xstrprintf ("%s.dwp", objfile_name (dwarf2_per_objfile->objfile));
cleanups = make_cleanup (xfree, dwp_name);
dbfd = open_dwp_file (dwp_name);
" [in module %s]"),
kind, dwo_name, hex_string (signature),
this_unit->is_debug_types ? "TU" : "CU",
- this_unit->offset.sect_off, objfile->name);
+ this_unit->offset.sect_off, objfile_name (objfile));
return NULL;
}
complaint (&symfile_complaints,
_("missing DW_AT_low_pc for DW_TAG_GNU_call_site "
"DIE 0x%x [in module %s]"),
- die->offset.sect_off, objfile->name);
+ die->offset.sect_off, objfile_name (objfile));
return;
}
pc = DW_ADDR (attr) + baseaddr;
complaint (&symfile_complaints,
_("Duplicate PC %s for DW_TAG_GNU_call_site "
"DIE 0x%x [in module %s]"),
- paddress (gdbarch, pc), die->offset.sect_off, objfile->name);
+ paddress (gdbarch, pc), die->offset.sect_off,
+ objfile_name (objfile));
return;
}
complaint (&symfile_complaints,
_("Tag %d is not DW_TAG_GNU_call_site_parameter in "
"DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"),
- child_die->tag, child_die->offset.sect_off, objfile->name);
+ child_die->tag, child_die->offset.sect_off,
+ objfile_name (objfile));
continue;
}
complaint (&symfile_complaints,
_("Cannot find function owning DW_TAG_GNU_call_site "
"DIE 0x%x [in module %s]"),
- die->offset.sect_off, objfile->name);
+ die->offset.sect_off, objfile_name (objfile));
}
}
complaint (&symfile_complaints,
_("DW_AT_GNU_call_site_target target DIE has invalid "
"physname, for referencing DIE 0x%x [in module %s]"),
- die->offset.sect_off, objfile->name);
+ die->offset.sect_off, objfile_name (objfile));
else
SET_FIELD_PHYSNAME (call_site->target, target_physname);
}
complaint (&symfile_complaints,
_("DW_AT_GNU_call_site_target target DIE has invalid "
"low pc, for referencing DIE 0x%x [in module %s]"),
- die->offset.sect_off, objfile->name);
+ die->offset.sect_off, objfile_name (objfile));
else
SET_FIELD_PHYSADDR (call_site->target, lowpc + baseaddr);
}
complaint (&symfile_complaints,
_("DW_TAG_GNU_call_site DW_AT_GNU_call_site_target is neither "
"block nor reference, for DIE 0x%x [in module %s]"),
- die->offset.sect_off, objfile->name);
+ die->offset.sect_off, objfile_name (objfile));
call_site->per_cu = cu->per_cu;
_("DW_AT_abstract_origin offset is not in CU for "
"DW_TAG_GNU_call_site child DIE 0x%x "
"[in module %s]"),
- child_die->offset.sect_off, objfile->name);
+ child_die->offset.sect_off, objfile_name (objfile));
continue;
}
parameter->u.param_offset.cu_off = (offset.sect_off
complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_location for "
"DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"),
- child_die->offset.sect_off, objfile->name);
+ child_die->offset.sect_off, objfile_name (objfile));
continue;
}
else
"for DW_FORM_block* DW_AT_location is supported for "
"DW_TAG_GNU_call_site child DIE 0x%x "
"[in module %s]"),
- child_die->offset.sect_off, objfile->name);
+ child_die->offset.sect_off, objfile_name (objfile));
continue;
}
}
complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_GNU_call_site_value for "
"DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"),
- child_die->offset.sect_off, objfile->name);
+ child_die->offset.sect_off, objfile_name (objfile));
continue;
}
parameter->value = DW_BLOCK (attr)->data;
complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_GNU_call_site_data_value for "
"DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"),
- child_die->offset.sect_off, objfile->name);
+ child_die->offset.sect_off, objfile_name (objfile));
else
{
parameter->data_value = DW_BLOCK (attr)->data;
{
complaint (&symfile_complaints,
_(".debug_ranges entry has start address of zero"
- " [in module %s]"), objfile->name);
+ " [in module %s]"), objfile_name (objfile));
continue;
}
{
complaint (&symfile_complaints,
_(".debug_ranges entry has start address of zero"
- " [in module %s]"), objfile->name);
+ " [in module %s]"), objfile_name (objfile));
continue;
}
_("Variable in common block has "
"DW_AT_data_member_location "
"- DIE at 0x%x [in module %s]"),
- child_die->offset.sect_off, cu->objfile->name);
+ child_die->offset.sect_off,
+ objfile_name (cu->objfile));
if (attr_form_is_section_offset (member_loc))
dwarf2_complex_location_expr_complaint ();
complaint (&symfile_complaints,
_("Self-referential DW_TAG_typedef "
"- DIE at 0x%x [in module %s]"),
- die->offset.sect_off, objfile->name);
+ die->offset.sect_off, objfile_name (objfile));
TYPE_TARGET_TYPE (this_type) = NULL;
}
return this_type;
else if (!low_default_is_valid)
complaint (&symfile_complaints, _("Missing DW_AT_lower_bound "
"- DIE at 0x%x [in module %s]"),
- die->offset.sect_off, cu->objfile->name);
+ die->offset.sect_off, objfile_name (cu->objfile));
attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
if (attr)
complaint (&symfile_complaints,
_("DW_TAG_typedef has childen - GCC PR debug/47510 bug "
"- DIE at 0x%x [in module %s]"),
- part_die->offset.sect_off, objfile->name);
+ part_die->offset.sect_off, objfile_name (objfile));
/* If we're at the second level, and we're an enumerator, and
our parent has no specification (meaning possibly lives in a
_("DW_AT_low_pc %s is zero "
"for DIE at 0x%x [in module %s]"),
paddress (gdbarch, part_die->lowpc),
- part_die->offset.sect_off, objfile->name);
+ part_die->offset.sect_off, objfile_name (objfile));
}
/* dwarf2_get_pc_bounds has also the strict low < high requirement. */
else if (part_die->lowpc >= part_die->highpc)
"for DIE at 0x%x [in module %s]"),
paddress (gdbarch, part_die->lowpc),
paddress (gdbarch, part_die->highpc),
- part_die->offset.sect_off, objfile->name);
+ part_die->offset.sect_off, objfile_name (objfile));
}
else
part_die->has_pc_info = 1;
dwarf2_read_section (objfile, &dwarf2_per_objfile->addr);
if (dwarf2_per_objfile->addr.buffer == NULL)
error (_("DW_FORM_addr_index used without .debug_addr section [in module %s]"),
- objfile->name);
+ objfile_name (objfile));
if (addr_base + addr_index * addr_size >= dwarf2_per_objfile->addr.size)
error (_("DW_FORM_addr_index pointing outside of "
".debug_addr section [in module %s]"),
- objfile->name);
+ objfile_name (objfile));
info_ptr = (dwarf2_per_objfile->addr.buffer
+ addr_base + addr_index * addr_size);
if (addr_size == 4)
struct dwarf2_cu *cu, ULONGEST str_index)
{
struct objfile *objfile = dwarf2_per_objfile->objfile;
- const char *dwo_name = objfile->name;
+ const char *dwo_name = objfile_name (objfile);
bfd *abfd = objfile->obfd;
struct dwo_sections *sections = &reader->dwo_file->sections;
const gdb_byte *info_ptr;
complaint (&symfile_complaints,
_(".debug_line address at offset 0x%lx is 0 "
"[in module %s]"),
- line_offset, objfile->name);
+ line_offset, objfile_name (objfile));
p_record_line = noop_record_line;
}
type_attr = dwarf2_attr (die, DW_AT_containing_type, cu);
if (!type_attr)
error (_("Dwarf Error: Problem turning containing type into gdb type "
- "[in module %s]"), cu->objfile->name);
+ "[in module %s]"), objfile_name (cu->objfile));
return lookup_die_type (die, type_attr, cu);
}
char *message, *saved;
message = xstrprintf (_("<unknown type in %s, CU 0x%x, DIE 0x%x>"),
- objfile->name,
+ objfile_name (objfile),
cu->header.offset.sect_off,
die->offset.sect_off);
saved = obstack_copy0 (&objfile->objfile_obstack,
_("Dwarf Error: Bad type attribute %s in DIE"
" at 0x%x [in module %s]"),
dwarf_attr_name (attr->name), die->offset.sect_off,
- objfile->name);
+ objfile_name (objfile));
return build_error_marker_type (cu, die);
}
{
dump_die_for_error (src_die);
error (_("Dwarf Error: Expected reference attribute [in module %s]"),
- (*ref_cu)->objfile->name);
+ objfile_name ((*ref_cu)->objfile));
}
return die;
if (!die)
error (_("Dwarf Error: Cannot find DIE at 0x%x referenced from DIE "
"at 0x%x [in module %s]"),
- offset.sect_off, src_die->offset.sect_off, cu->objfile->name);
+ offset.sect_off, src_die->offset.sect_off,
+ objfile_name (cu->objfile));
return die;
}
die = follow_die_offset (offset, per_cu->is_dwz, &cu);
if (!die)
error (_("Dwarf Error: Cannot find DIE at 0x%x referenced in module %s"),
- offset.sect_off, per_cu->objfile->name);
+ offset.sect_off, objfile_name (per_cu->objfile));
attr = dwarf2_attr (die, DW_AT_location, cu);
if (!attr)
if (!attr_form_is_block (attr))
error (_("Dwarf Error: DIE at 0x%x referenced in module %s "
"is neither DW_FORM_block* nor DW_FORM_exprloc"),
- offset.sect_off, per_cu->objfile->name);
+ offset.sect_off, objfile_name (per_cu->objfile));
retval.data = DW_BLOCK (attr)->data;
retval.size = DW_BLOCK (attr)->size;
die = follow_die_offset (offset, per_cu->is_dwz, &cu);
if (!die)
error (_("Dwarf Error: Cannot find DIE at 0x%x referenced in module %s"),
- offset.sect_off, per_cu->objfile->name);
+ offset.sect_off, objfile_name (per_cu->objfile));
attr = dwarf2_attr (die, DW_AT_const_value, cu);
error (_("Dwarf Error: Cannot find signatured DIE %s referenced"
" from DIE at 0x%x [in module %s]"),
hex_string (signature), src_die->offset.sect_off,
- (*ref_cu)->objfile->name);
+ objfile_name ((*ref_cu)->objfile));
}
die = follow_die_sig_1 (src_die, sig_type, ref_cu);
error (_("Dwarf Error: Problem reading signatured DIE %s referenced"
" from DIE at 0x%x [in module %s]"),
hex_string (signature), src_die->offset.sect_off,
- (*ref_cu)->objfile->name);
+ objfile_name ((*ref_cu)->objfile));
}
return die;
_("Dwarf Error: Cannot find signatured DIE %s referenced"
" from DIE at 0x%x [in module %s]"),
hex_string (signature), die->offset.sect_off,
- dwarf2_per_objfile->objfile->name);
+ objfile_name (dwarf2_per_objfile->objfile));
return build_error_marker_type (cu, die);
}
_("Dwarf Error: Cannot build signatured type %s"
" referenced from DIE at 0x%x [in module %s]"),
hex_string (signature), die->offset.sect_off,
- dwarf2_per_objfile->objfile->name);
+ objfile_name (dwarf2_per_objfile->objfile));
type = build_error_marker_type (cu, die);
}
}
_("Dwarf Error: Problem reading signatured DIE %s referenced"
" from DIE at 0x%x [in module %s]"),
hex_string (signature), die->offset.sect_off,
- dwarf2_per_objfile->objfile->name);
+ objfile_name (dwarf2_per_objfile->objfile));
type = build_error_marker_type (cu, die);
}
sig_type->type = type;
_("Dwarf Error: DW_AT_signature has bad form %s in DIE"
" at 0x%x [in module %s]"),
dwarf_form_name (attr->form), die->offset.sect_off,
- dwarf2_per_objfile->objfile->name);
+ objfile_name (dwarf2_per_objfile->objfile));
return build_error_marker_type (cu, die);
}
}
if (!objfile->psymtabs || !objfile->psymtabs_addrmap)
return;
- if (stat (objfile->name, &st) < 0)
- perror_with_name (objfile->name);
+ if (stat (objfile_name (objfile), &st) < 0)
+ perror_with_name (objfile_name (objfile));
- filename = concat (dir, SLASH_STRING, lbasename (objfile->name),
+ filename = concat (dir, SLASH_STRING, lbasename (objfile_name (objfile)),
INDEX_SUFFIX, (char *) NULL);
cleanup = make_cleanup (xfree, filename);
struct stat st;
/* If the objfile does not correspond to an actual file, skip it. */
- if (stat (objfile->name, &st) < 0)
+ if (stat (objfile_name (objfile), &st) < 0)
continue;
dwarf2_per_objfile = objfile_data (objfile, dwarf2_objfile_data_key);
if (except.reason < 0)
exception_fprintf (gdb_stderr, except,
_("Error while writing index for `%s': "),
- objfile->name);
+ objfile_name (objfile));
}
}
}
build_id_name = build_id_to_debug_filename (build_id);
/* Prevent looping on a stripped .debug file. */
if (build_id_name != NULL
- && filename_cmp (build_id_name, objfile->name) == 0)
+ && filename_cmp (build_id_name, objfile_name (objfile)) == 0)
{
warning (_("\"%s\": separate debug info file has no debug info"),
build_id_name);
{
fprintf_unfiltered (gdb_stdlog,
"Reading minimal symbols of objfile %s ...\n",
- objfile->name);
+ objfile_name (objfile));
}
init_minimal_symbol_collection ();
gdb_print_host_address (exp->elts[elt + 1].type, stream);
fprintf_filtered (stream, " (__thread /* \"%s\" */ ",
(exp->elts[elt].objfile == NULL ? "(null)"
- : exp->elts[elt].objfile->name));
+ : objfile_name (exp->elts[elt].objfile)));
type_print (exp->elts[elt + 1].type, NULL, stream, 0);
fprintf_filtered (stream, ")");
elt = dump_subexp (exp, stream, elt + 3);
name = type_name_no_tag (saved_type);
objfile = TYPE_OBJFILE (saved_type);
error (_("Invalid anonymous type %s [in module %s], GCC PR debug/47510 bug?"),
- name ? name : "<anonymous>", objfile ? objfile->name : "<arch>");
+ name ? name : "<anonymous>",
+ objfile ? objfile_name (objfile) : "<arch>");
}
/* Lookup a typedef or primitive type named NAME, visible in lexical
terminate_minimal_symbol_table (objfile);
- objfile->name = "<< JIT compiled code >>";
+ objfile->original_name = "<< JIT compiled code >>";
j = NULL;
for (i = obj->symtabs; i; i = j)
struct cleanup *cleanup;
char *path, *cp;
int result;
+ const char *obj_name = objfile_name (obj);
- if (obj->name[0] != '/')
+ if (obj_name[0] != '/')
{
warning (_("Expected absolute pathname for libpthread in the"
- " inferior, but got %s."), obj->name);
+ " inferior, but got %s."), obj_name);
return 0;
}
- path = xmalloc (strlen (obj->name) + (subdir ? strlen (subdir) + 1 : 0)
+ path = xmalloc (strlen (obj_name) + (subdir ? strlen (subdir) + 1 : 0)
+ 1 + strlen (LIBTHREAD_DB_SO) + 1);
cleanup = make_cleanup (xfree, path);
- strcpy (path, obj->name);
+ strcpy (path, obj_name);
cp = strrchr (path, '/');
/* This should at minimum hit the first character. */
gdb_assert (cp != NULL);
return 0;
ALL_OBJFILES (obj)
- if (libpthread_name_p (obj->name))
+ if (libpthread_name_p (objfile_name (obj)))
{
if (try_thread_db_load_from_pdir_1 (obj, subdir))
return 1;
struct objfile *obj;
ALL_OBJFILES (obj)
- if (libpthread_name_p (obj->name))
+ if (libpthread_name_p (objfile_name (obj)))
return 1;
return 0;
of the list of shared libraries to load, and in an app of several
thousand shared libraries, this can otherwise be painful. */
&& ((objfile->flags & OBJF_MAINLINE) != 0
- || libpthread_name_p (objfile->name)))
+ || libpthread_name_p (objfile_name (objfile))))
check_for_thread_db ();
}
/* Debugging symbols are not expected here. */
complaint (&symfile_complaints,
_("%s: Unexpected debug stab outside SO markers"),
- objfile->name);
+ objfile_name (objfile));
}
else
{
static bfd *
macho_check_dsym (struct objfile *objfile)
{
- size_t name_len = strlen (objfile->name);
+ size_t name_len = strlen (objfile_name (objfile));
size_t dsym_len = strlen (DSYM_SUFFIX);
- const char *base_name = lbasename (objfile->name);
+ const char *base_name = lbasename (objfile_name (objfile));
size_t base_len = strlen (base_name);
char *dsym_filename = alloca (name_len + dsym_len + base_len + 1);
bfd *dsym_bfd;
bfd_mach_o_load_command *main_uuid;
bfd_mach_o_load_command *dsym_uuid;
- strcpy (dsym_filename, objfile->name);
+ strcpy (dsym_filename, objfile_name (objfile));
strcpy (dsym_filename + name_len, DSYM_SUFFIX);
strcpy (dsym_filename + name_len + dsym_len, base_name);
if (bfd_mach_o_lookup_command (objfile->obfd,
BFD_MACH_O_LC_UUID, &main_uuid) == 0)
{
- warning (_("can't find UUID in %s"), objfile->name);
+ warning (_("can't find UUID in %s"), objfile_name (objfile));
return NULL;
}
dsym_bfd = gdb_bfd_openr (dsym_filename, gnutarget);
if (memcmp (dsym_uuid->command.uuid.uuid, main_uuid->command.uuid.uuid,
sizeof (main_uuid->command.uuid.uuid)))
{
- warning (_("dsym file UUID doesn't match the one in %s"), objfile->name);
+ warning (_("dsym file UUID doesn't match the one in %s"),
+ objfile_name (objfile));
gdb_bfd_unref (dsym_bfd);
return NULL;
}
if (mach_o_debug_level > 0)
printf_unfiltered (_("Relocate section '%s' of %s\n"),
- sectp->name, objfile->name);
+ sectp->name, objfile_name (objfile));
return bfd_simple_get_relocated_section_contents (abfd, sectp, buf, NULL);
}
gdb_assert (sect->the_bfd_section && sect->the_bfd_section->name);
section_name = sect->the_bfd_section->name;
- gdb_assert (sect->objfile && sect->objfile->name);
- obj_name = sect->objfile->name;
+ gdb_assert (sect->objfile && objfile_name (sect->objfile));
+ obj_name = objfile_name (sect->objfile);
if (MULTI_OBJFILE_P ())
printf_filtered (_("%s + %s in section %s of %s\n"),
return NULL;
#ifdef HAVE_LIBLZMA
- abfd = gdb_bfd_openr_iovec (objfile->name, gnutarget, lzma_open, section,
- lzma_pread, lzma_close, lzma_stat);
+ abfd = gdb_bfd_openr_iovec (objfile_name (objfile), gnutarget, lzma_open,
+ section, lzma_pread, lzma_close, lzma_stat);
if (abfd == NULL)
return NULL;
{
fprintf_unfiltered (gdb_stdlog,
"Installing %d minimal symbols of objfile %s.\n",
- msym_count, objfile->name);
+ msym_count, objfile_name (objfile));
}
/* Allocate enough space in the obstack, into which we will gather the
gdb_bfd_ref (abfd);
if (abfd != NULL)
{
- objfile->name = bfd_get_filename (abfd);
+ objfile->original_name = bfd_get_filename (abfd);
objfile->mtime = bfd_get_mtime (abfd);
/* Build section table. */
}
else
{
- objfile->name = "<<anonymous objfile>>";
+ objfile->original_name = "<<anonymous objfile>>";
}
objfile->per_bfd = get_objfile_bfd_data (objfile, abfd);
" (A) section `%s' from `%s' [%s, %s)\n"
" (B) section `%s' from `%s' [%s, %s).\n"
"Will ignore section B"),
- bfd_section_name (abfd1, bfds1), objf1->name,
+ bfd_section_name (abfd1, bfds1), objfile_name (objf1),
paddress (gdbarch, sect1_addr),
paddress (gdbarch, sect1_endaddr),
- bfd_section_name (abfd2, bfds2), objf2->name,
+ bfd_section_name (abfd2, bfds2), objfile_name (objf2),
paddress (gdbarch, sect2_addr),
paddress (gdbarch, sect2_endaddr));
}
}
}
+/* Return canonical name for OBJFILE. */
+
+const char *
+objfile_name (const struct objfile *objfile)
+{
+ return objfile->original_name;
+}
+
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_objfiles;
pointer is never NULL. This does not have to be freed; it is
guaranteed to have a lifetime at least as long as the objfile. */
- char *name;
+ char *original_name;
CORE_ADDR addr_low;
void set_objfile_per_bfd (struct objfile *obj);
+const char *objfile_name (const struct objfile *objfile);
+
#endif /* !defined (OBJFILES_H) */
a pagination request inside printf_filtered. */
old_chain = make_cleanup (xfree, loc_string);
- gdb_assert (osect->objfile && osect->objfile->name);
- obj_name = osect->objfile->name;
+ gdb_assert (osect->objfile && objfile_name (osect->objfile));
+ obj_name = objfile_name (osect->objfile);
if (MULTI_OBJFILE_P ())
if (pc_in_unmapped_range (addr, osect))
printf_filtered (_("a thread-local variable at offset %s "
"in the thread-local storage for `%s'"),
paddress (gdbarch, load_addr),
- section->objfile->name);
+ objfile_name (section->objfile));
else
{
printf_filtered (_("static storage at address "));
continue;
if (objfile_namestr
- && FILENAME_CMP (objfile->name, objfile_namestr) != 0
- && FILENAME_CMP (lbasename (objfile->name), objfile_namestr) != 0)
+ && FILENAME_CMP (objfile_name (objfile), objfile_namestr) != 0
+ && FILENAME_CMP (lbasename (objfile_name (objfile)),
+ objfile_namestr) != 0)
continue;
probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
if (objname)
{
- if (regexec (&obj_pat, objfile->name, 0, NULL, 0) != 0)
+ if (regexec (&obj_pat, objfile_name (objfile), 0, NULL, 0) != 0)
continue;
}
if (pa->address > pb->address)
return 1;
- return strcmp (pa->objfile->name, pb->objfile->name);
+ return strcmp (objfile_name (pa->objfile), objfile_name (pb->objfile));
}
/* Helper function that generate entries in the ui_out table being
{
size_name = max (strlen (probe->name), size_name);
size_provider = max (strlen (probe->provider), size_provider);
- size_objname = max (strlen (probe->objfile->name), size_objname);
+ size_objname = max (strlen (objfile_name (probe->objfile)), size_objname);
}
ui_out_table_header (current_uiout, size_provider, ui_left, "provider",
else
print_ui_out_info (probe);
- ui_out_field_string (current_uiout, "object", probe->objfile->name);
+ ui_out_field_string (current_uiout, "object",
+ objfile_name (probe->objfile));
ui_out_text (current_uiout, "\n");
do_cleanups (inner);
exec_file_attach (src->pspace_exec_filename, 0);
if (src->symfile_object_file != NULL)
- symbol_file_add_main (src->symfile_object_file->name, 0);
+ symbol_file_add_main (objfile_name (src->symfile_object_file), 0);
do_cleanups (old_chain);
return dest;
if (verbose)
{
printf_unfiltered (_("Reading symbols from %s..."),
- objfile->name);
+ objfile_name (objfile));
gdb_flush (gdb_stdout);
}
(*objfile->sf->sym_read_psymbols) (objfile);
gdb_print_host_address (psymtab, outfile);
fprintf_filtered (outfile, ")\n\n");
fprintf_unfiltered (outfile, " Read from object file %s (",
- objfile->name);
+ objfile_name (objfile));
gdb_print_host_address (objfile, outfile);
fprintf_unfiltered (outfile, ")\n");
static char *last_objfile_name = NULL;
if (last_objfile_name == NULL
- || strcmp (last_objfile_name, objfile->name) != 0)
+ || strcmp (last_objfile_name, objfile_name (objfile)) != 0)
{
xfree (last_objfile_name);
- last_objfile_name = xstrdup (objfile->name);
+ last_objfile_name = xstrdup (objfile_name (objfile));
fprintf_unfiltered (gdb_stdlog,
"Creating one or more psymtabs for objfile %s ...\n",
last_objfile_name);
{
if (! printed_objfile_start)
{
- printf_filtered ("{ objfile %s ", objfile->name);
+ printf_filtered ("{ objfile %s ", objfile_name (objfile));
wrap_here (" ");
printf_filtered ("((struct objfile *) %s)\n",
host_address_to_string (objfile));
is_safe = file_is_auto_load_safe (filename,
_("auto-load: Loading Python script \"%s\" "
"by extension for objfile \"%s\".\n"),
- filename, objfile->name);
+ filename, objfile_name (objfile));
/* Add this script to the hash table too so "info auto-load python-scripts"
can print it. */
"\"%s\" from section \"%s\" of "
"objfile \"%s\".\n"),
full_path, GDBPY_AUTO_SECTION_NAME,
- objfile->name))
+ objfile_name (objfile)))
opened = 0;
}
else
warning (_("Missing auto-load scripts referenced in section %s\n\
of file %s\n\
Use `info auto-load python [REGEXP]' to list them."),
- GDBPY_AUTO_SECTION_NAME, objfile->name);
+ GDBPY_AUTO_SECTION_NAME, objfile_name (objfile));
}
/* If one script isn't found it's not uncommon for more to not be
objfile_object *obj = (objfile_object *) self;
if (obj->objfile)
- return PyString_Decode (obj->objfile->name, strlen (obj->objfile->name),
+ return PyString_Decode (objfile_name (obj->objfile),
+ strlen (objfile_name (obj->objfile)),
host_charset (), NULL);
Py_RETURN_NONE;
}
struct objfile *objfile = obj->pspace->symfile_object_file;
if (objfile)
- return PyString_Decode (objfile->name, strlen (objfile->name),
+ return PyString_Decode (objfile_name (objfile),
+ strlen (objfile_name (objfile)),
host_charset (), NULL);
}
Py_RETURN_NONE;
if (data_osect == NULL)
error (_("unable to find TOC entry for pc %s "
"(%s has no data section)"),
- core_addr_to_string (pc), pc_osect->objfile->name);
+ core_addr_to_string (pc), objfile_name (pc_osect->objfile));
result = (obj_section_addr (data_osect)
+ xcoff_get_toc_offset (pc_osect->objfile));
static int
match_main (const char *name)
{
- return strcmp (name, symfile_objfile->name) == 0;
+ return strcmp (name, objfile_name (symfile_objfile)) == 0;
}
static struct so_list *
{
/* Oh what a pain! We need the offsets before so_list->objfile
is valid. The BFDs will never match. Make a best guess. */
- if (strstr (objfile->name, so_list->so_name))
+ if (strstr (objfile_name (objfile), so_list->so_name))
{
asection *private_section;
struct obj_section *sect;
/* Have we already loaded this shared object? */
ALL_OBJFILES (so->objfile)
{
- if (filename_cmp (so->objfile->name, so->so_name) == 0
+ if (filename_cmp (objfile_name (so->objfile), so->so_name) == 0
&& so->objfile->addr_low == so->addr_low)
break;
}
complaint (&symfile_complaints,
_("%s: common block `%s' from "
"global_sym_chain unresolved"),
- objfile->name, SYMBOL_PRINT_NAME (prev));
+ objfile_name (objfile), SYMBOL_PRINT_NAME (prev));
}
}
memset (global_sym_chain, 0, sizeof (global_sym_chain));
if (!ret->p.name)
{
complaint (&symfile_complaints, _("corrupt probe name when "
- "reading `%s'"), objfile->name);
+ "reading `%s'"),
+ objfile_name (objfile));
/* There is no way to use a probe without a name or a provider, so
returning zero here makes sense. */
!= el->data + el->size - 1))
{
complaint (&symfile_complaints, _("corrupt probe argument when "
- "reading `%s'"), objfile->name);
+ "reading `%s'"),
+ objfile_name (objfile));
/* If the argument string is NULL, it means some problem happened with
it. So we return 0. */
return;
&& from_tty
&& (symfile_objfile
? !query (_("Discard symbol table from `%s'? "),
- symfile_objfile->name)
+ objfile_name (symfile_objfile))
: !query (_("Discard symbol table? "))))
error (_("Not confirmed."));
".debug" suffix as "/usr/lib/debug/path/to/file" is a separate tree where
the separate debug infos with the same basename can exist. */
- if (filename_cmp (name, parent_objfile->name) == 0)
+ if (filename_cmp (name, objfile_name (parent_objfile)) == 0)
return 0;
abfd = gdb_bfd_open_maybe_remote (name);
if (verified_as_different || parent_crc != file_crc)
warning (_("the debug information found in \"%s\""
" does not match \"%s\" (CRC mismatch).\n"),
- name, parent_objfile->name);
+ name, objfile_name (parent_objfile));
return 0;
}
}
cleanups = make_cleanup (xfree, debuglink);
- dir = xstrdup (objfile->name);
+ dir = xstrdup (objfile_name (objfile));
make_cleanup (xfree, dir);
terminate_after_last_dir_separator (dir);
canon_dir = lrealpath (dir);
struct stat st_buf;
- if (lstat (objfile->name, &st_buf) == 0 && S_ISLNK(st_buf.st_mode))
+ if (lstat (objfile_name (objfile), &st_buf) == 0
+ && S_ISLNK (st_buf.st_mode))
{
char *symlink_dir;
- symlink_dir = lrealpath (objfile->name);
+ symlink_dir = lrealpath (objfile_name (objfile));
if (symlink_dir != NULL)
{
make_cleanup (xfree, symlink_dir);
if (objfile->obfd->my_archive)
res = stat (objfile->obfd->my_archive->filename, &new_statbuf);
else
- res = stat (objfile->name, &new_statbuf);
+ res = stat (objfile_name (objfile), &new_statbuf);
if (res != 0)
{
/* FIXME, should use print_sys_errmsg but it's not filtered. */
printf_unfiltered (_("`%s' has disappeared; keeping its symbols.\n"),
- objfile->name);
+ objfile_name (objfile));
continue;
}
new_modtime = new_statbuf.st_mtime;
int num_offsets;
printf_unfiltered (_("`%s' has changed; re-reading symbols.\n"),
- objfile->name);
+ objfile_name (objfile));
/* There are various functions like symbol_file_add,
symfile_bfd_open, syms_from_objfile, etc., which might
gdb_bfd_unref (obfd);
}
- objfile->name = bfd_get_filename (objfile->obfd);
+ objfile->original_name = bfd_get_filename (objfile->obfd);
/* bfd_openr sets cacheable to true, which is what we want. */
if (!bfd_check_format (objfile->obfd, bfd_object))
- error (_("Can't read symbols from %s: %s."), objfile->name,
+ error (_("Can't read symbols from %s: %s."), objfile_name (objfile),
bfd_errmsg (bfd_get_error ()));
/* Save the offsets, we will nuke them with the rest of the
static char *last_objfile_name = NULL;
if (last_objfile_name == NULL
- || strcmp (last_objfile_name, objfile->name) != 0)
+ || strcmp (last_objfile_name, objfile_name (objfile)) != 0)
{
xfree (last_objfile_name);
- last_objfile_name = xstrdup (objfile->name);
+ last_objfile_name = xstrdup (objfile_name (objfile));
fprintf_unfiltered (gdb_stdlog,
"Creating one or more symtabs for objfile %s ...\n",
last_objfile_name);
ALL_PSPACE_OBJFILES (pspace, objfile)
{
QUIT;
- printf_filtered (_("Byte cache statistics for '%s':\n"), objfile->name);
+ printf_filtered (_("Byte cache statistics for '%s':\n"),
+ objfile_name (objfile));
print_bcache_statistics (psymbol_bcache_get_bcache (objfile->psymbol_cache),
"partial symbol cache");
print_bcache_statistics (objfile->per_bfd->macro_cache,
ALL_PSPACE_OBJFILES (pspace, objfile)
{
QUIT;
- printf_filtered (_("Statistics for '%s':\n"), objfile->name);
+ printf_filtered (_("Statistics for '%s':\n"), objfile_name (objfile));
if (OBJSTAT (objfile, n_stabs) > 0)
printf_filtered (_(" Number of \"stab\" symbols read: %d\n"),
OBJSTAT (objfile, n_stabs));
{
struct symtab *symtab;
- printf_filtered ("\nObject file %s: ", objfile->name);
+ printf_filtered ("\nObject file %s: ", objfile_name (objfile));
printf_filtered ("Objfile at ");
gdb_print_host_address (objfile, gdb_stdout);
printf_filtered (", bfd at ");
int index;
char ms_type;
- fprintf_filtered (outfile, "\nObject file %s:\n\n", objfile->name);
+ fprintf_filtered (outfile, "\nObject file %s:\n\n", objfile_name (objfile));
if (objfile->minimal_symbol_count == 0)
{
fprintf_filtered (outfile, "No minimal symbols found.\n");
if (symtab->dirname)
fprintf_filtered (outfile, "Compilation directory is %s\n",
symtab->dirname);
- fprintf_filtered (outfile, "Read from object file %s (", objfile->name);
+ fprintf_filtered (outfile, "Read from object file %s (",
+ objfile_name (objfile));
gdb_print_host_address (objfile, outfile);
fprintf_filtered (outfile, ")\n");
fprintf_filtered (outfile, "Language: %s\n",
ALL_PSPACE_OBJFILES (pspace, objfile)
{
QUIT;
- if (symname == NULL || (!stat (objfile->name, &obj_st)
+ if (symname == NULL || (!stat (objfile_name (objfile), &obj_st)
&& sym_st.st_dev == obj_st.st_dev
&& sym_st.st_ino == obj_st.st_ino))
dump_msymbols (objfile, outfile);
{
QUIT;
if (! regexp
- || re_exec (objfile->name))
+ || re_exec (objfile_name (objfile)))
dump_objfile (objfile);
}
}
{
if (! printed_objfile_start)
{
- printf_filtered ("{ objfile %s ", objfile->name);
+ printf_filtered ("{ objfile %s ", objfile_name (objfile));
wrap_here (" ");
printf_filtered ("((struct objfile *) %s)\n",
host_address_to_string (objfile));
{
if (! printed_objfile_start)
{
- printf_filtered ("{ objfile %s ", objfile->name);
+ printf_filtered ("{ objfile %s ", objfile_name (objfile));
wrap_here (" ");
printf_filtered ("((struct objfile *) %s)\n",
host_address_to_string (objfile));
case TLS_LOAD_MODULE_NOT_FOUND_ERROR:
if (objfile_is_library)
error (_("Cannot find shared library `%s' in dynamic"
- " linker's load module list"), objfile->name);
+ " linker's load module list"), objfile_name (objfile));
else
error (_("Cannot find executable file `%s' in dynamic"
- " linker's load module list"), objfile->name);
+ " linker's load module list"), objfile_name (objfile));
break;
case TLS_NOT_ALLOCATED_YET_ERROR:
if (objfile_is_library)
" thread-local variables in\n"
"the shared library `%s'\n"
"for %s"),
- objfile->name, target_pid_to_str (ptid));
+ objfile_name (objfile), target_pid_to_str (ptid));
else
error (_("The inferior has not yet allocated storage for"
" thread-local variables in\n"
"the executable `%s'\n"
"for %s"),
- objfile->name, target_pid_to_str (ptid));
+ objfile_name (objfile), target_pid_to_str (ptid));
break;
case TLS_GENERIC_ERROR:
if (objfile_is_library)
error (_("Cannot find thread-local storage for %s, "
"shared library %s:\n%s"),
target_pid_to_str (ptid),
- objfile->name, ex.message);
+ objfile_name (objfile), ex.message);
else
error (_("Cannot find thread-local storage for %s, "
"executable file %s:\n%s"),
target_pid_to_str (ptid),
- objfile->name, ex.message);
+ objfile_name (objfile), ex.message);
break;
default:
throw_exception (ex);
int has_all_mem = 0;
if (symfile_objfile != NULL)
- printf_unfiltered (_("Symbols from \"%s\".\n"), symfile_objfile->name);
+ printf_unfiltered (_("Symbols from \"%s\".\n"),
+ objfile_name (symfile_objfile));
for (t = target_stack; t != NULL; t = t->beneath)
{
file_ptr symtab_offset; /* symbol table and */
file_ptr stringtab_offset; /* string table file offsets */
struct coff_symfile_info *info;
- char *name;
+ const char *name;
unsigned int size;
info = XCOFF_DATA (objfile);
symfile_bfd = abfd = objfile->obfd;
- name = objfile->name;
+ name = objfile_name (objfile);
num_symbols = bfd_get_symcount (abfd); /* # of symbols */
symtab_offset = obj_sym_filepos (abfd); /* symbol table file offset */