#define O_BINARY 0
#endif
-#ifdef HPUXHPPA
-
-/* Some HP-UX related globals to clear when a new "main"
- symbol file is loaded. HP-specific. */
-
-extern int hp_cxx_exception_support_initialized;
-#define RESET_HP_UX_GLOBALS() do {\
- deprecated_hp_som_som_object_present = 0; /* indicates HP-compiled code */ \
- hp_cxx_exception_support_initialized = 0; /* must reinitialize exception stuff */ \
- } while (0)
-#endif
-
-int (*ui_load_progress_hook) (const char *section, unsigned long num);
-void (*show_load_progress) (const char *section,
+int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
+void (*deprecated_show_load_progress) (const char *section,
unsigned long section_sent,
unsigned long section_size,
unsigned long total_sent,
unsigned long total_size);
-void (*pre_add_symbol_hook) (const char *);
-void (*post_add_symbol_hook) (void);
-void (*target_new_objfile_hook) (struct objfile *);
+void (*deprecated_pre_add_symbol_hook) (const char *);
+void (*deprecated_post_add_symbol_hook) (void);
+void (*deprecated_target_new_objfile_hook) (struct objfile *);
static void clear_symtab_users_cleanup (void *ignore);
struct partial_symbol *const *s1 = s1p;
struct partial_symbol *const *s2 = s2p;
- return strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*s1),
- SYMBOL_NATURAL_NAME (*s2));
+ return strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*s1),
+ SYMBOL_SEARCH_NAME (*s2));
}
void
performed, or need to read an unmapped symbol table. */
if (from_tty || info_verbose)
{
- if (pre_add_symbol_hook)
- pre_add_symbol_hook (name);
+ if (deprecated_pre_add_symbol_hook)
+ deprecated_pre_add_symbol_hook (name);
else
{
printf_unfiltered ("Reading symbols from %s...", name);
if (from_tty || info_verbose)
{
- if (post_add_symbol_hook)
- post_add_symbol_hook ();
+ if (deprecated_post_add_symbol_hook)
+ deprecated_post_add_symbol_hook ();
else
{
printf_unfiltered ("done.\n");
new_symfile_objfile (objfile, mainline, from_tty);
- if (target_new_objfile_hook)
- target_new_objfile_hook (objfile);
+ if (deprecated_target_new_objfile_hook)
+ deprecated_target_new_objfile_hook (objfile);
return (objfile);
}
+/* Process the symbol file ABFD, as either the main file or as a
+ dynamically loaded file.
+
+ See symbol_file_add_with_addrs_or_offsets's comments for
+ details. */
+struct objfile *
+symbol_file_add_from_bfd (bfd *abfd, int from_tty,
+ struct section_addr_info *addrs,
+ int mainline, int flags)
+{
+ return symbol_file_add_with_addrs_or_offsets (abfd,
+ from_tty, addrs, 0, 0,
+ mainline, flags);
+}
+
+
/* Process a symbol file, as either the main file or as a dynamically
loaded file. See symbol_file_add_with_addrs_or_offsets's comments
for details. */
symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
int mainline, int flags)
{
- return symbol_file_add_with_addrs_or_offsets (symfile_bfd_open (name),
- from_tty, addrs, 0, 0,
- mainline, flags);
+ return symbol_file_add_from_bfd (symfile_bfd_open (name), from_tty,
+ addrs, mainline, flags);
}
{
symbol_file_add (args, from_tty, NULL, 1, flags);
-#ifdef HPUXHPPA
- RESET_HP_UX_GLOBALS ();
-#endif
-
/* Getting new symbols may change our opinion about
what is frameless. */
reinit_frame_cache ();
symfile_objfile = NULL;
if (from_tty)
printf_unfiltered ("No symbol file now.\n");
-#ifdef HPUXHPPA
- RESET_HP_UX_GLOBALS ();
-#endif
}
static char *
{
bfd_size_type *sum = data;
- *sum += bfd_get_section_size_before_reloc (asec);
+ *sum += bfd_get_section_size (asec);
}
/* Opaque data for load_section_callback. */
if (bfd_get_section_flags (abfd, asec) & SEC_LOAD)
{
- bfd_size_type size = bfd_get_section_size_before_reloc (asec);
+ bfd_size_type size = bfd_get_section_size (asec);
if (size > 0)
{
char *buffer;
args->write_count += 1;
sent += len;
if (quit_flag
- || (ui_load_progress_hook != NULL
- && ui_load_progress_hook (sect_name, sent)))
+ || (deprecated_ui_load_progress_hook != NULL
+ && deprecated_ui_load_progress_hook (sect_name, sent)))
error ("Canceled the download");
- if (show_load_progress != NULL)
- show_load_progress (sect_name, sent, size,
- args->data_count, args->total_size);
+ if (deprecated_show_load_progress != NULL)
+ deprecated_show_load_progress (sect_name, sent, size,
+ args->data_count,
+ args->total_size);
}
while (sent < size);
#endif
}
\f
-#if 0
-/* Read inferior memory at ADDR to find the header of a loaded object file
- and read its in-core symbols out of inferior memory. TEMPL is a bfd
- representing the target's format. */
-struct objfile *
-symbol_file_add_from_memory (bfd *templ, CORE_ADDR addr, int from_tty)
-{
- struct objfile *objf;
- bfd *nbfd;
- asection *sec;
- bfd_vma loadbase;
- struct section_addr_info *sai;
- unsigned int i;
-
- if (bfd_get_flavour (templ) != bfd_target_elf_flavour)
- error ("add-symbol-file-from-memory not supported for this target");
-
- nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase,
- target_read_memory);
- if (nbfd == NULL)
- {
- error ("Failed to read a valid object file image from memory.");
- return NULL;
- }
-
- nbfd->filename = xstrdup ("shared object read from target memory");
-
- if (!bfd_check_format (nbfd, bfd_object))
- {
- /* FIXME: should be checking for errors from bfd_close (for one thing,
- on error it does not free all the storage associated with the
- bfd). */
- bfd_close (nbfd);
- error ("Got object file from memory but can't read symbols: %s.",
- bfd_errmsg (bfd_get_error ()));
- return NULL;
- }
-
- sai = alloc_section_addr_info (bfd_count_sections (nbfd));
- make_cleanup (xfree, sai);
- i = 0;
- for (sec = nbfd->sections; sec != NULL; sec = sec->next)
- if ((bfd_get_section_flags (nbfd, sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
- {
- sai->other[i].addr = bfd_get_section_vma (nbfd, sec) + loadbase;
- sai->other[i].name = (char *) bfd_get_section_name (nbfd, sec);
- sai->other[i].sectindex = sec->index;
- ++i;
- }
-
- objf = symbol_file_add_with_addrs_or_offsets (nbfd, from_tty,
- sai, NULL, 0, 0, OBJF_SHARED);
-
- /* This might change our ideas about frames already looked at. */
- reinit_frame_cache ();
-
- return objf;
-}
-#endif
-
-static void
-add_symbol_file_from_memory_command (char *args, int from_tty)
-{
-#if 0
- CORE_ADDR addr;
- bfd *templ;
-
- if (args == NULL)
- error ("add-symbol-file-from-memory requires an expression argument");
-
- addr = parse_and_eval_address (args);
-
- /* We need some representative bfd to know the target we are looking at. */
- if (symfile_objfile != NULL)
- templ = symfile_objfile->obfd;
- else
- templ = exec_bfd;
- if (templ == NULL)
- error ("\
-Must use symbol-file or exec-file before add-symbol-file-from-memory.");
-
- symbol_file_add_from_memory (templ, addr, from_tty);
-#else
- error ("add-symbol-file-from-memory not implemented");
-#endif
-}
-\f
/* Re-read symbols if a symbol-file has changed. */
void
reread_symbols (void)
if (objfile == symfile_objfile)
{
(*objfile->sf->sym_new_init) (objfile);
-#ifdef HPUXHPPA
- RESET_HP_UX_GLOBALS ();
-#endif
}
(*objfile->sf->sym_init) (objfile);
set_default_breakpoint (0, 0, 0, 0);
clear_current_source_symtab_and_line ();
clear_pc_function_cache ();
- if (target_new_objfile_hook)
- target_new_objfile_hook (NULL);
+ if (deprecated_target_new_objfile_hook)
+ deprecated_target_new_objfile_hook (NULL);
}
static void
if (overlay_debugging)
if (section && section_is_overlay (section))
{
- size = bfd_get_section_size_before_reloc (section);
+ size = bfd_get_section_size (section);
if (section->lma <= pc && pc < section->lma + size)
return 1;
}
if (overlay_debugging)
if (section && section_is_overlay (section))
{
- size = bfd_get_section_size_before_reloc (section);
+ size = bfd_get_section_size (section);
if (section->vma <= pc && pc < section->vma + size)
return 1;
}
/* FIXME: need bfd *, so we can use bfd_section_vma methods. */
CORE_ADDR a_start = a->vma;
- CORE_ADDR a_end = a->vma + bfd_get_section_size_before_reloc (a);
+ CORE_ADDR a_end = a->vma + bfd_get_section_size (a);
CORE_ADDR b_start = b->vma;
- CORE_ADDR b_end = b->vma + bfd_get_section_size_before_reloc (b);
+ CORE_ADDR b_end = b->vma + bfd_get_section_size (b);
return (a_start < b_end && b_start < a_end);
}
vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
- size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+ size = bfd_get_section_size (osect->the_bfd_section);
name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
printf_filtered ("Section %s, loaded at ", name);
bfd *obfd = osect->objfile->obfd;
asection *bsect = osect->the_bfd_section;
- size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+ size = bfd_get_section_size (osect->the_bfd_section);
for (i = 0; i < cache_novlys; i++)
if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
bfd *obfd = osect->objfile->obfd;
asection *bsect = osect->the_bfd_section;
- size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+ size = bfd_get_section_size (bsect);
for (i = 0; i < cache_novlys; i++)
if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
&cmdlist);
set_cmd_completer (c, filename_completer);
- c = add_cmd ("add-symbol-file-from-memory", class_files,
- add_symbol_file_from_memory_command,
- "\
-Load the symbols out of memory from a dynamically loaded object file.\n\
-Give an expression for the address of the file's shared object file header.",
- &cmdlist);
-
c = add_cmd ("add-shared-symbol-files", class_files,
add_shared_symbol_files_command,
"Load the symbols from shared objects in the dynamic linker's link map.",