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.
This commit is contained in:
Andrew Cagney 2004-05-25 21:55:43 +00:00
parent 378fce5bd7
commit 97c34f656c
5 changed files with 19 additions and 53 deletions

View File

@ -1,3 +1,15 @@
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.

View File

@ -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) \

View File

@ -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");

View File

@ -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 */

View File

@ -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);