diff options
author | Kung Hsu <kung@cygnus> | 1994-03-01 23:13:56 +0000 |
---|---|---|
committer | Kung Hsu <kung@cygnus> | 1994-03-01 23:13:56 +0000 |
commit | 1340861c99fc5ca7f4acacbdaa449f1d4c57eb80 (patch) | |
tree | 81dddce5ec765062988b2b06eec7dbca18a2e91c /gdb/symfile.c | |
parent | bb37e7161e6c7f271f56d8b920cb3a0ad06116de (diff) | |
download | gdb-1340861c99fc5ca7f4acacbdaa449f1d4c57eb80.zip gdb-1340861c99fc5ca7f4acacbdaa449f1d4c57eb80.tar.gz gdb-1340861c99fc5ca7f4acacbdaa449f1d4c57eb80.tar.bz2 |
Modified Files:
ChangeLog objfiles.c objfiles.h symfile.c target.c main.c
Makefile.in configure.in
Added Files:
os9kread.c os9kstab.c remote-os9k.c
* os9kread.c: New file to read os9000 style symbo table.
* os9kstab.c: new file to read os9000 style stabs.
* remote-os9k.c: remote protocol talking to os9000 rombug monitor.
* objfiles.c (find_pc_objfile): new function to search objfile
from pc.
* objfiles.c (objfile_relocate_data): new function to relocate
data symbols in symbol table.
* objfiles.h: Add two aux fields in struct objfile to handle
multiple symbol table files situation like in os9000.
* symfile.c: Change so 'symbol-file' command can handle multiple
files. Also call target_link() to get relocation infos.
* target.c (target_link): new function to get relocation info when
a symbol file is requested to load.
* main.c (quit_command): take out 'inferior_pid != 0' condition,
because in cross mode there's no inferior pid, bit they need to
be detached.
Makefile.in: add os9kread.c os9kstab.c and .o's.
configure.in: add i386os9k target.
config/i386/i386os9k.mt: new add.
config/i386/tm-i386os9k.h: new add.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index a0d7095..cb998bf 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -48,7 +48,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #endif /* Global variables owned by this file */ - +CORE_ADDR text_relocation = 0; /* text_relocation */ int readnow_symbol_files; /* Read full symbols immediately */ struct complaint oldsyms_complaint = { @@ -675,7 +675,23 @@ symbol_file_command (args, from_tty) } else { + char *p; + name = *argv; + + /* this is for rombug remote only, to get the text relocation by + using link command */ + p = strrchr(name, '/'); + if (p != NULL) p++; + else p = name; + + target_link(p, &text_relocation); + + if (text_relocation) + symbol_file_add (name, from_tty, (CORE_ADDR)text_relocation, 0, mapped, readnow); + else + symbol_file_add (name, from_tty, (CORE_ADDR)0, 1, mapped, readnow); + set_initial_language (); } argv++; } @@ -684,11 +700,6 @@ symbol_file_command (args, from_tty) { error ("no symbol file name was specified"); } - else - { - symbol_file_add (name, from_tty, (CORE_ADDR)0, 1, mapped, readnow); - set_initial_language (); - } do_cleanups (cleanups); } } @@ -972,14 +983,23 @@ add_symbol_file_command (args, from_tty) left pointing at the remainder of the command line, which should be the address expression to evaluate. */ - if ((name == NULL) || (*args == '\000') ) + if (name == NULL) { - error ("add-symbol-file takes a file name and an address"); + error ("add-symbol-file takes a file name"); } name = tilde_expand (name); make_cleanup (free, name); - text_addr = parse_and_eval_address (args); + if (*args != '\000') + { + text_addr = parse_and_eval_address (args); + } + else + { + target_link(name, &text_addr); + if (text_addr == (CORE_ADDR)-1) + error("Don't know how to get text start location for this file"); + } /* FIXME-32x64: Assumes text_addr fits in a long. */ if (!query ("add symbol table from file \"%s\" at text_addr = %s?\n", @@ -1078,10 +1098,12 @@ reread_symbols () if (objfile->global_psymbols.list) mfree (objfile->md, objfile->global_psymbols.list); objfile->global_psymbols.list = NULL; + objfile->global_psymbols.next = NULL; objfile->global_psymbols.size = 0; if (objfile->static_psymbols.list) mfree (objfile->md, objfile->static_psymbols.list); objfile->static_psymbols.list = NULL; + objfile->static_psymbols.next = NULL; objfile->static_psymbols.size = 0; /* Free the obstacks for non-reusable objfiles */ |