From: Andrew Cagney Date: Tue, 25 May 2004 21:55:43 +0000 (+0000) Subject: 2004-05-25 Andrew Cagney X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=97c34f656c6045d6daf0b2a20f0e9de6da5a955a;p=binutils-gdb.git 2004-05-25 Andrew Cagney * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 99aea542563..dd24fe530a0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2004-05-25 Andrew Cagney + + * 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 * gdb-mi.el: New file. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 42a6ffd1029..d90ea94c38d 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -757,7 +757,6 @@ srec_h = srec.h 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 @@ -2446,8 +2445,7 @@ symfile.o: symfile.c $(defs_h) $(bfdlink_h) $(symtab_h) $(gdbtypes_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) \ diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c index d914ac733d9..00bce17a3fc 100644 --- a/gdb/symfile-mem.c +++ b/gdb/symfile-mem.c @@ -52,18 +52,17 @@ #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; @@ -74,10 +73,7 @@ symbol_file_add_from_memory (bfd *templ, CORE_ADDR addr, int from_tty) 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"); @@ -89,7 +85,6 @@ symbol_file_add_from_memory (bfd *templ, CORE_ADDR addr, int from_tty) 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)); @@ -118,7 +113,7 @@ static void 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"); diff --git a/gdb/symfile-mem.h b/gdb/symfile-mem.h deleted file mode 100644 index b89d589ebba..00000000000 --- a/gdb/symfile-mem.h +++ /dev/null @@ -1,33 +0,0 @@ -/* 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 */ diff --git a/gdb/symfile.h b/gdb/symfile.h index 4c085969c4c..b76d3baddc8 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -306,12 +306,6 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *); /* 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);