* symfile.h (symbol_file_add_from_memory): Delete declaration.
* symfile-mem.h: Delete file.
* symfile-mem.c: Do not include "symfile-mem.h".
(symbol_file_add_from_memory): Make static. Use "struct bfd" and
"struct bfd_section". When an error do not bother returning NULL.
(add_symbol_file_from_memory_command): Use "struct bfd" and
"struct bfd_section".
* Makefile.in (symfile_mem_h): Delete.
(symfile-mem.o): Update dependencies.
+2004-05-25 Andrew Cagney <cagney@gnu.org>
+
+ * symfile.h (symbol_file_add_from_memory): Delete declaration.
+ * symfile-mem.h: Delete file.
+ * symfile-mem.c: Do not include "symfile-mem.h".
+ (symbol_file_add_from_memory): Make static. Use "struct bfd" and
+ "struct bfd_section". When an error do not bother returning NULL.
+ (add_symbol_file_from_memory_command): Use "struct bfd" and
+ "struct bfd_section".
+ * Makefile.in (symfile_mem_h): Delete.
+ (symfile-mem.o): Update dependencies.
+
2004-05-25 Nick Roberts <nickrob@gnu.org>
* gdb-mi.el: New file.
stabsread_h = stabsread.h
stack_h = stack.h
symfile_h = symfile.h
-symfile_mem_h = symfile-mem.h
symtab_h = symtab.h
target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h)
terminal_h = terminal.h
$(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
$(gdb_string_h) $(gdb_stat_h)
symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
- $(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_h) \
- $(symfile_mem_h)
+ $(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_h)
symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \
$(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \
$(gdb_obstack_h) $(language_h) $(bcache_h) $(block_h) $(gdb_regex_h) \
#include "target.h"
#include "value.h"
#include "symfile.h"
-#include "symfile-mem.h"
/* 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)
+static struct objfile *
+symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, int from_tty)
{
struct objfile *objf;
- bfd *nbfd;
- asection *sec;
+ struct bfd *nbfd;
+ struct bfd_section *sec;
bfd_vma loadbase;
struct section_addr_info *sai;
unsigned int i;
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;
- }
+ error ("Failed to read a valid object file image from memory.");
nbfd->filename = xstrdup ("shared object read from target memory");
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));
add_symbol_file_from_memory_command (char *args, int from_tty)
{
CORE_ADDR addr;
- bfd *templ;
+ struct bfd *templ;
if (args == NULL)
error ("add-symbol-file-from-memory requires an expression argument");
+++ /dev/null
-/* Declarations for reading symbol files from memory into GDB.
-
- Copyright 2004 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#if !defined (SYMFILE_MEM_H)
-#define SYMFILE_MEM_H
-
-/* You must #include "bfd.h" and "defs.h" before #including this file. */
-
-/* Forward declarations. */
-struct objfile;
-
-struct objfile *(symbol_file_add_from_memory
- (bfd *templ, CORE_ADDR addr, int from_tty));
-
-#endif /* SYMFILE_MEM_H */
/* Load symbols from a file. */
extern void symbol_file_add_main (char *args, int from_tty);
-/* 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. */
-extern struct objfile *symbol_file_add_from_memory (bfd *templ, CORE_ADDR addr,
- int from_tty);
-
/* Clear GDB symbol tables. */
extern void symbol_file_clear (int from_tty);