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.
This commit is contained in:
Kung Hsu 1994-03-01 23:13:56 +00:00
parent bb37e7161e
commit 1340861c99
11 changed files with 5074 additions and 13 deletions

View File

@ -1,3 +1,26 @@
Tue Mar 1 14:56:14 1994 Kung Hsu (kung@mexican.cygnus.com)
* 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.
Tue Mar 1 13:16:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* config/sparc/tm-sun4sol2.h (IN_SIGTRAMP): Handle ucbsigvechandler.

View File

@ -178,7 +178,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
VERSION = 4.12.1
VERSION = 4.12.2
DIST=gdb
LINT=/usr/5bin/lint
@ -305,7 +305,8 @@ SFILES = blockframe.c breakpoint.c buildsym.c c-exp.y c-lang.c \
mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
printcmd.c remote.c source.c stabsread.c stack.c symfile.c symmisc.c \
symtab.c target.c thread.c typeprint.c utils.c valarith.c valops.c \
valprint.c values.c serial.c ser-unix.c mdebugread.c
valprint.c values.c serial.c ser-unix.c mdebugread.c os9kread.c \
os9kstab.c
# Files that are not source code, but need to go into
# gdb-$(VERSION).tar.Z.
@ -442,7 +443,7 @@ OBS = version.o main.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
dwarfread.o mipsread.o stabsread.o core.o c-lang.o ch-lang.o m2-lang.o \
complaints.o typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o nlmread.o \
serial.o mdebugread.o
serial.o mdebugread.o os9kread.o os9kstab.o
TSOBS = inflow.o
@ -1275,6 +1276,14 @@ mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h)
os9kread.o: os9kread.c buildsym.h complaints.h $(bfd_h) $(def_h) \
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h)
os9kstab.o: os9kstab.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \
$(INCLUDE_DIR)/aout/stab_gnu.h buildsym.h complaints.h $(defs_h) \
$(gdbtypes_h) objfiles.h stabsread.h symfile.h $(symtab_h)
mem-break.o: mem-break.c $(defs_h)
minsyms.o: minsyms.c $(bfd_h) $(defs_h) objfiles.h symfile.h \

View File

@ -59,6 +59,7 @@ i[34]86-*-sysv4*) gdb_host=i386v4 ;;
i[34]86-*-unixware) gdb_host=i386v4 ;;
i[34]86-*-sysv*) gdb_host=i386v ;;
i[34]86-*-isc*) gdb_host=i386v32 ;;
i[34]86-*-os9k) gdb_host=i386os9k ;;
m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
@ -199,6 +200,7 @@ i[34]86-*-elf*) gdb_target=i386v ;;
i[34]86-*-aix*) gdb_target=i386aix ;;
i[34]86-*-bsd*) gdb_target=i386bsd ;;
i[34]86-*-netbsd*) gdb_target=i386bsd ;;
i[34]86-*-os9k) gdb_target=i386os9k ;;
i[34]86-*-go32*) gdb_target=i386aout ;;
i[34]86-*-lynxos*) gdb_target=i386lynx
configdirs="${configdirs} gdbserver"

View File

@ -2222,7 +2222,10 @@ quit_command (args, from_tty)
char *args;
int from_tty;
{
if (inferior_pid != 0 && target_has_execution)
/* kung: inferior_pid may not exist in cross mode debugging,
I commented it out temporarily, if it does not cause other problem,
we should take it out permenantly. */
if (/*inferior_pid != 0 &&*/ target_has_execution)
{
if (attach_flag)
{
@ -2239,9 +2242,13 @@ quit_command (args, from_tty)
error ("Not confirmed.");
}
}
/* UDI wants this, to kill the TIP. */
target_close (1);
/* Save the history information if it is appropriate to do so. */
if (write_history_p && history_filename)
write_history (history_filename);
exit (0);
}

View File

@ -421,6 +421,21 @@ free_all_objfiles ()
clear_symtab_users ();
}
struct objfile *
find_pc_objfile(pc)
CORE_ADDR pc;
{
struct objfile *obj;
struct obj_section *s;
ALL_OBJFILES (obj)
for (s = obj->sections; s < obj->sections_end; s++)
{
if (s->addr <= pc && s->endaddr > pc) return obj;
}
return (struct objfile *)NULL;
}
/* Relocate OBJFILE to NEW_OFFSETS. There should be OBJFILE->NUM_SECTIONS
entries in new_offsets. */
void
@ -540,6 +555,107 @@ objfile_relocate (objfile, new_offsets)
}
}
/* Relocate OBJFILE to NEW_OFFSETS. There should be OBJFILE->NUM_SECTIONS
entries in new_offsets. */
void
objfile_relocate_data (objfile, new_offsets)
struct objfile *objfile;
struct section_offsets *new_offsets;
{
struct section_offsets *delta = (struct section_offsets *) alloca
(sizeof (struct section_offsets)
+ objfile->num_sections * sizeof (delta->offsets));
{
int i;
int something_changed = 0;
for (i = 0; i < objfile->num_sections; ++i)
{
if (i != SECT_OFF_DATA && i != SECT_OFF_BSS)
ANOFFSET (delta, i) = 0;
else
ANOFFSET (delta, i) = ANOFFSET(new_offsets, i)
- ANOFFSET (objfile->section_offsets, i);
if (ANOFFSET (delta, i) != 0)
something_changed = 1;
}
if (!something_changed)
return;
}
/* OK, get all the symtabs. */
{
struct symtab *s;
for (s = objfile->symtabs; s; s = s->next)
{
struct linetable *l;
struct blockvector *bv;
int i;
/* Don't relocate a shared blockvector more than once. */
if (!s->primary)
continue;
bv = BLOCKVECTOR (s);
for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
{
struct block *b;
int j;
b = BLOCKVECTOR_BLOCK (bv, i);
BLOCK_START (b) += ANOFFSET (delta, s->block_line_section);
BLOCK_END (b) += ANOFFSET (delta, s->block_line_section);
for (j = 0; j < BLOCK_NSYMS (b); ++j)
{
struct symbol *sym = BLOCK_SYM (b, j);
/* The RS6000 code from which this was taken skipped
any symbols in STRUCT_NAMESPACE or UNDEF_NAMESPACE.
But I'm leaving out that test, on the theory that
they can't possibly pass the tests below. */
if ((SYMBOL_CLASS (sym) == LOC_LABEL
|| SYMBOL_CLASS (sym) == LOC_STATIC)
&& SYMBOL_SECTION (sym) >= 0)
{
SYMBOL_VALUE_ADDRESS (sym) +=
ANOFFSET (delta, SYMBOL_SECTION (sym));
}
}
}
}
}
{
struct partial_symbol *psym;
for (psym = objfile->global_psymbols.list;
psym < objfile->global_psymbols.next;
psym++)
if (SYMBOL_SECTION (psym) >= 0)
SYMBOL_VALUE_ADDRESS (psym) += ANOFFSET (delta, SYMBOL_SECTION (psym));
for (psym = objfile->static_psymbols.list;
psym < objfile->static_psymbols.next;
psym++)
if (SYMBOL_SECTION (psym) >= 0)
SYMBOL_VALUE_ADDRESS (psym) += ANOFFSET (delta, SYMBOL_SECTION (psym));
}
{
struct minimal_symbol *msym;
ALL_OBJFILE_MSYMBOLS (objfile, msym)
if (SYMBOL_SECTION (msym) >= 0)
SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym));
}
{
int i;
for (i = 0; i < objfile->num_sections; ++i)
if (i == SECT_OFF_DATA || i == SECT_OFF_BSS)
ANOFFSET (objfile->section_offsets, i) = ANOFFSET (new_offsets, i);
}
}
/* Many places in gdb want to test just to see if we have any partial
symbols available. This function returns zero if none are currently
available, nonzero otherwise. */

View File

@ -310,6 +310,9 @@ struct objfile
struct obj_section
*sections,
*sections_end;
/* two auxiliary fields, used to hold the fp of separate symbol files */
FILE *auxf1, *auxf2;
};
/* Defines for the objfile flag word. */
@ -370,6 +373,8 @@ extern void free_objfile PARAMS ((struct objfile *));
extern void
free_all_objfiles PARAMS ((void));
extern struct objfile * find_pc_objfile PARAMS ((CORE_ADDR));
extern void
objfile_relocate PARAMS ((struct objfile *, struct section_offsets *));

1659
gdb/os9kread.c Normal file

File diff suppressed because it is too large Load Diff

2024
gdb/os9kstab.c Normal file

File diff suppressed because it is too large Load Diff

1181
gdb/remote-os9k.c Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -710,6 +710,19 @@ target_detach (args, from_tty)
(current_target->to_detach) (args, from_tty);
}
void
target_link (modname, t_reloc)
char *modname;
CORE_ADDR *t_reloc;
{
if (STREQ(current_target->to_shortname, "rombug"))
{
(current_target->to_lookup_symbol) (modname, t_reloc);
}
else
*t_reloc = (CORE_ADDR)-1;
}
/* Look through the list of possible targets for a target that can
execute a run or attach command without any other data. This is
used to locate the default process stratum.