* os9kread.c (os9k_process_one_symbol): Rename
VARIABLES_INSIDE_BLOCK to OS9K_VARIABLES_INSIDE_BLOCK. * symfile.c (symbol_file_command): Check for (CORE_ADDR)-1, not (CORE_ADDR)0, from target_link, since that is what it uses. Process name at end, not during parsing (like we did before Kung's change), so that -readnow and -mapped can appear anywhere. Make text_relocation a local variable. * config/i386/i386os9k.mt: Fix comment. * Makefile.in (ALLDEPFILES): Add remote-os9k.c. * os9kread.c: Put "comments" after #endif inside /* */. * stabsread.h: Add os9k_stabs variable. * stabsread.c (start_stabs), os9kread.c (os9k_process_one_symbol): Set it. * stabsread.c (define_symbol): If os9k_stabs, put a 'V' symbol descriptor in global_symbols not local_symbols. (read_type): If os9k_stabs, accept 'c', 'i', and 'b' type descriptors. (read_type): If os9k_stabs, accept function parameters after 'f' type descriptor. (read_array_type): If os9k_stabs, don't expect index type and expect lower and upper to be separated by ',' not ';'. (read_enum_type): If os9k_stabs, read a number before the first enumeration constant. (os9k_init_type_vector): New function. (dbx_lookup_type): Call it when starting new type vector. * config/i386/tm-i386os9k.h: Define BELIEVE_PCC_PROMOTION. * (os9k_process_one_symbol): Call define_symbol not os9k_define_symbol. * os9kstab.c: Removed. * Makefile.in: Update accordingly. * objfiles.c (objfile_relocate_data): Removed. * remote-os9k.c (rombug_wait): Call objfile_relocate not objfile_relocate_data. * objfiles.h, objfiles.c: Remove find_pc_objfile. * remote-os9k.c (rombug_wait): Call find_pc_section not find_pc_objfile. * main.c (quit_command): Check inferior_pid; revert Kung change. * remote-os9k.c (rombug_create_inferior): Set inferior_pid.
This commit is contained in:
parent
6e2194f077
commit
25200748a2
14 changed files with 192 additions and 2207 deletions
|
@ -186,6 +186,7 @@ ns32k-pinsn.c
|
||||||
ns32km3-nat.c
|
ns32km3-nat.c
|
||||||
objfiles.c
|
objfiles.c
|
||||||
objfiles.h
|
objfiles.h
|
||||||
|
os9kread.c
|
||||||
osfsolib.c
|
osfsolib.c
|
||||||
paread.c
|
paread.c
|
||||||
parse.c
|
parse.c
|
||||||
|
@ -210,6 +211,7 @@ remote-mips.c
|
||||||
remote-mm.c
|
remote-mm.c
|
||||||
remote-mon.c
|
remote-mon.c
|
||||||
remote-nindy.c
|
remote-nindy.c
|
||||||
|
remote-os9k.c
|
||||||
remote-sim.c
|
remote-sim.c
|
||||||
remote-sim.h
|
remote-sim.h
|
||||||
remote-st.c
|
remote-st.c
|
||||||
|
|
|
@ -1,3 +1,43 @@
|
||||||
|
Tue Mar 1 16:22:56 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
|
||||||
|
|
||||||
|
* os9kread.c (os9k_process_one_symbol): Rename
|
||||||
|
VARIABLES_INSIDE_BLOCK to OS9K_VARIABLES_INSIDE_BLOCK.
|
||||||
|
* symfile.c (symbol_file_command): Check for (CORE_ADDR)-1, not
|
||||||
|
(CORE_ADDR)0, from target_link, since that is what it uses.
|
||||||
|
Process name at end, not during parsing (like we did before Kung's
|
||||||
|
change), so that -readnow and -mapped can appear anywhere.
|
||||||
|
Make text_relocation a local variable.
|
||||||
|
* config/i386/i386os9k.mt: Fix comment.
|
||||||
|
* Makefile.in (ALLDEPFILES): Add remote-os9k.c.
|
||||||
|
* os9kread.c: Put "comments" after #endif inside /* */.
|
||||||
|
* stabsread.h: Add os9k_stabs variable.
|
||||||
|
* stabsread.c (start_stabs), os9kread.c (os9k_process_one_symbol):
|
||||||
|
Set it.
|
||||||
|
* stabsread.c (define_symbol): If os9k_stabs, put a 'V' symbol
|
||||||
|
descriptor in global_symbols not local_symbols.
|
||||||
|
(read_type): If os9k_stabs, accept 'c', 'i', and 'b' type
|
||||||
|
descriptors.
|
||||||
|
(read_type): If os9k_stabs, accept function parameters after 'f'
|
||||||
|
type descriptor.
|
||||||
|
(read_array_type): If os9k_stabs, don't expect index type and
|
||||||
|
expect lower and upper to be separated by ',' not ';'.
|
||||||
|
(read_enum_type): If os9k_stabs, read a number before the first
|
||||||
|
enumeration constant.
|
||||||
|
(os9k_init_type_vector): New function.
|
||||||
|
(dbx_lookup_type): Call it when starting new type vector.
|
||||||
|
* config/i386/tm-i386os9k.h: Define BELIEVE_PCC_PROMOTION.
|
||||||
|
* (os9k_process_one_symbol): Call define_symbol not os9k_define_symbol.
|
||||||
|
* os9kstab.c: Removed.
|
||||||
|
* Makefile.in: Update accordingly.
|
||||||
|
* objfiles.c (objfile_relocate_data): Removed.
|
||||||
|
* remote-os9k.c (rombug_wait): Call objfile_relocate
|
||||||
|
not objfile_relocate_data.
|
||||||
|
* objfiles.h, objfiles.c: Remove find_pc_objfile.
|
||||||
|
* remote-os9k.c (rombug_wait): Call find_pc_section not
|
||||||
|
find_pc_objfile.
|
||||||
|
* main.c (quit_command): Check inferior_pid; revert Kung change.
|
||||||
|
* remote-os9k.c (rombug_create_inferior): Set inferior_pid.
|
||||||
|
|
||||||
Tue Mar 1 14:56:14 1994 Kung Hsu (kung@mexican.cygnus.com)
|
Tue Mar 1 14:56:14 1994 Kung Hsu (kung@mexican.cygnus.com)
|
||||||
|
|
||||||
* os9kread.c: New file to read os9000 style symbo table.
|
* os9kread.c: New file to read os9000 style symbo table.
|
||||||
|
|
|
@ -305,8 +305,7 @@ 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 \
|
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 \
|
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 \
|
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 os9kread.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
|
# Files that are not source code, but need to go into
|
||||||
# gdb-$(VERSION).tar.Z.
|
# gdb-$(VERSION).tar.Z.
|
||||||
|
@ -443,7 +442,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 \
|
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 \
|
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 \
|
c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o nlmread.o \
|
||||||
serial.o mdebugread.o os9kread.o os9kstab.o
|
serial.o mdebugread.o os9kread.o
|
||||||
|
|
||||||
TSOBS = inflow.o
|
TSOBS = inflow.o
|
||||||
|
|
||||||
|
@ -893,7 +892,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
|
||||||
paread.c procfs.c pyr-pinsn.c pyr-tdep.c pyr-xdep.c \
|
paread.c procfs.c pyr-pinsn.c pyr-tdep.c pyr-xdep.c \
|
||||||
remote-adapt.c remote-bug.c remote-e7000.c remote-eb.c remote-es.c \
|
remote-adapt.c remote-bug.c remote-e7000.c remote-eb.c remote-es.c \
|
||||||
remote-hms.c remote-mips.c \
|
remote-hms.c remote-mips.c \
|
||||||
remote-mm.c remote-mon.c remote-nindy.c remote-sim.c \
|
remote-mm.c remote-mon.c remote-nindy.c remote-os9k.c remote-sim.c \
|
||||||
remote-st.c remote-utils.c dcache.c \
|
remote-st.c remote-utils.c dcache.c \
|
||||||
remote-udi.c remote-vx.c remote-z8k.c rs6000-nat.c rs6000-pinsn.c \
|
remote-udi.c remote-vx.c remote-z8k.c rs6000-nat.c rs6000-pinsn.c \
|
||||||
rs6000-tdep.c ser-go32.c ser-tcp.c sh-tdep.c solib.c sparc-nat.c \
|
rs6000-tdep.c ser-go32.c ser-tcp.c sh-tdep.c solib.c sparc-nat.c \
|
||||||
|
@ -1280,10 +1279,6 @@ os9kread.o: os9kread.c buildsym.h complaints.h $(bfd_h) $(def_h) \
|
||||||
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
|
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
|
||||||
objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_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)
|
mem-break.o: mem-break.c $(defs_h)
|
||||||
|
|
||||||
minsyms.o: minsyms.c $(bfd_h) $(defs_h) objfiles.h symfile.h \
|
minsyms.o: minsyms.c $(bfd_h) $(defs_h) objfiles.h symfile.h \
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Target: Intel 386 running BSD
|
# Target: Intel 386 running OS9000
|
||||||
TDEPFILES= exec.o i386-tdep.o i386-pinsn.o remote-os9k.o
|
TDEPFILES= exec.o i386-tdep.o i386-pinsn.o remote-os9k.o
|
||||||
TM_FILE= tm-i386os9k.h
|
TM_FILE= tm-i386os9k.h
|
||||||
|
|
|
@ -85,3 +85,5 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
? sigtramp_saved_pc (FRAME) \
|
? sigtramp_saved_pc (FRAME) \
|
||||||
: read_memory_integer ((FRAME)->frame + 4, 4)) \
|
: read_memory_integer ((FRAME)->frame + 4, 4)) \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#define BELIEVE_PCC_PROMOTION 1
|
||||||
|
|
|
@ -2222,10 +2222,7 @@ quit_command (args, from_tty)
|
||||||
char *args;
|
char *args;
|
||||||
int from_tty;
|
int from_tty;
|
||||||
{
|
{
|
||||||
/* kung: inferior_pid may not exist in cross mode debugging,
|
if (inferior_pid != 0 && target_has_execution)
|
||||||
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)
|
if (attach_flag)
|
||||||
{
|
{
|
||||||
|
|
116
gdb/objfiles.c
116
gdb/objfiles.c
|
@ -421,21 +421,6 @@ free_all_objfiles ()
|
||||||
clear_symtab_users ();
|
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
|
/* Relocate OBJFILE to NEW_OFFSETS. There should be OBJFILE->NUM_SECTIONS
|
||||||
entries in new_offsets. */
|
entries in new_offsets. */
|
||||||
void
|
void
|
||||||
|
@ -555,107 +540,6 @@ 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
|
/* 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
|
symbols available. This function returns zero if none are currently
|
||||||
available, nonzero otherwise. */
|
available, nonzero otherwise. */
|
||||||
|
|
|
@ -373,8 +373,6 @@ extern void free_objfile PARAMS ((struct objfile *));
|
||||||
extern void
|
extern void
|
||||||
free_all_objfiles PARAMS ((void));
|
free_all_objfiles PARAMS ((void));
|
||||||
|
|
||||||
extern struct objfile * find_pc_objfile PARAMS ((CORE_ADDR));
|
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
objfile_relocate PARAMS ((struct objfile *, struct section_offsets *));
|
objfile_relocate PARAMS ((struct objfile *, struct section_offsets *));
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
#include "language.h" /* Needed inside partial-stab.h */
|
#include "language.h" /* Needed inside partial-stab.h */
|
||||||
#include "complaints.h"
|
#include "complaints.h"
|
||||||
#include "os9k.h"
|
#include "os9k.h"
|
||||||
|
#include "stabsread.h"
|
||||||
|
|
||||||
#if !defined (SEEK_SET)
|
#if !defined (SEEK_SET)
|
||||||
#define SEEK_SET 0
|
#define SEEK_SET 0
|
||||||
|
@ -130,9 +131,6 @@ static struct complaint lbrac_unmatched_complaint =
|
||||||
static struct complaint lbrac_mismatch_complaint =
|
static struct complaint lbrac_mismatch_complaint =
|
||||||
{"IBE/IDE symbol mismatch at symtab pos %d", 0, 0};
|
{"IBE/IDE symbol mismatch at symtab pos %d", 0, 0};
|
||||||
|
|
||||||
extern struct symbol *
|
|
||||||
os9k_define_symbol PARAMS ((CORE_ADDR, char *, int, int, struct objfile *));
|
|
||||||
|
|
||||||
|
|
||||||
/* Local function prototypes */
|
/* Local function prototypes */
|
||||||
static void
|
static void
|
||||||
|
@ -1347,7 +1345,7 @@ os9k_read_ofile_symtab (pst)
|
||||||
bfd_seek (symfile_bfd, sym_offset, SEEK_CUR);
|
bfd_seek (symfile_bfd, sym_offset, SEEK_CUR);
|
||||||
processing_gcc_compilation = 0;
|
processing_gcc_compilation = 0;
|
||||||
}
|
}
|
||||||
#endif 0
|
#endif /* 0 */
|
||||||
|
|
||||||
fseek(dbg_file, (long)sym_offset, 0);
|
fseek(dbg_file, (long)sym_offset, 0);
|
||||||
/*
|
/*
|
||||||
|
@ -1400,7 +1398,7 @@ os9k_read_ofile_symtab (pst)
|
||||||
section. */
|
section. */
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
#endif 0
|
#endif /* 0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
current_objfile = NULL;
|
current_objfile = NULL;
|
||||||
|
@ -1454,7 +1452,7 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
|
||||||
but this should not be an error (). */
|
but this should not be an error (). */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif 0
|
#endif /* 0 */
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
@ -1469,11 +1467,11 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
|
||||||
valu += last_source_start_addr;
|
valu += last_source_start_addr;
|
||||||
new = pop_context();
|
new = pop_context();
|
||||||
|
|
||||||
#if !defined (VARIABLES_INSIDE_BLOCK)
|
#if !defined (OS9K_VARIABLES_INSIDE_BLOCK)
|
||||||
#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) 1
|
#define OS9K_VARIABLES_INSIDE_BLOCK(desc, gcc_p) 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
|
if (!OS9K_VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
|
||||||
local_symbols = new->locals;
|
local_symbols = new->locals;
|
||||||
|
|
||||||
if (context_stack_depth > 1)
|
if (context_stack_depth > 1)
|
||||||
|
@ -1521,7 +1519,7 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
|
if (OS9K_VARIABLES_INSIDE_BLOCK(desc, processing_gcc_compilation))
|
||||||
/* Now pop locals of block just finished. */
|
/* Now pop locals of block just finished. */
|
||||||
local_symbols = new->locals;
|
local_symbols = new->locals;
|
||||||
break;
|
break;
|
||||||
|
@ -1571,6 +1569,7 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
|
||||||
end_stabs ();
|
end_stabs ();
|
||||||
}
|
}
|
||||||
start_stabs ();
|
start_stabs ();
|
||||||
|
os9k_stabs = 1;
|
||||||
start_symtab (n, dirn, valu);
|
start_symtab (n, dirn, valu);
|
||||||
} else {
|
} else {
|
||||||
push_subfile();
|
push_subfile();
|
||||||
|
@ -1585,17 +1584,17 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
|
||||||
|
|
||||||
within_function = 1;
|
within_function = 1;
|
||||||
new = push_context (0, valu);
|
new = push_context (0, valu);
|
||||||
new->name = os9k_define_symbol (valu, name, desc, type, objfile);
|
new->name = define_symbol (valu, name, desc, type, objfile);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
case 'v':
|
case 'v':
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
|
valu += ANOFFSET (section_offsets, SECT_OFF_DATA);
|
||||||
os9k_define_symbol (valu, name, desc, type, objfile);
|
define_symbol (valu, name, desc, type, objfile);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
os9k_define_symbol (valu, name, desc, type, objfile);
|
define_symbol (valu, name, desc, type, objfile);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2024
gdb/os9kstab.c
2024
gdb/os9kstab.c
File diff suppressed because it is too large
Load diff
|
@ -289,6 +289,9 @@ rombug_create_inferior (execfile, args, env)
|
||||||
{
|
{
|
||||||
int entry_pt;
|
int entry_pt;
|
||||||
|
|
||||||
|
/* Nonzero value indicates that a process really is running. */
|
||||||
|
inferior_pid = 42;
|
||||||
|
|
||||||
if (args && *args)
|
if (args && *args)
|
||||||
error("Can't pass arguments to remote ROMBUG process");
|
error("Can't pass arguments to remote ROMBUG process");
|
||||||
|
|
||||||
|
@ -471,7 +474,7 @@ rombug_wait (pid, status)
|
||||||
int old_timeout = timeout;
|
int old_timeout = timeout;
|
||||||
struct section_offsets *offs;
|
struct section_offsets *offs;
|
||||||
CORE_ADDR addr, pc;
|
CORE_ADDR addr, pc;
|
||||||
struct objfile *obj;
|
struct obj_section *obj_sec;
|
||||||
|
|
||||||
#ifdef LOG_FILE
|
#ifdef LOG_FILE
|
||||||
fputs ("\nIn wait ()", log_file);
|
fputs ("\nIn wait ()", log_file);
|
||||||
|
@ -489,9 +492,11 @@ rombug_wait (pid, status)
|
||||||
rombug_fetch_registers();
|
rombug_fetch_registers();
|
||||||
pc = read_register(PC_REGNUM);
|
pc = read_register(PC_REGNUM);
|
||||||
addr = read_register(DATABASE_REG);
|
addr = read_register(DATABASE_REG);
|
||||||
obj = find_pc_objfile(pc);
|
|
||||||
if (obj != NULL)
|
obj_sec = find_pc_section (pc);
|
||||||
new_symfile_objfile(obj, 1, 0);
|
if (obj_sec != NULL)
|
||||||
|
new_symfile_objfile (obj_sec, 1, 0);
|
||||||
|
|
||||||
offs = ((struct section_offsets *)
|
offs = ((struct section_offsets *)
|
||||||
alloca (sizeof (struct section_offsets)
|
alloca (sizeof (struct section_offsets)
|
||||||
+ (symfile_objfile->num_sections * sizeof (offs->offsets))));
|
+ (symfile_objfile->num_sections * sizeof (offs->offsets))));
|
||||||
|
@ -501,7 +506,10 @@ rombug_wait (pid, status)
|
||||||
ANOFFSET (offs, SECT_OFF_DATA) = addr;
|
ANOFFSET (offs, SECT_OFF_DATA) = addr;
|
||||||
ANOFFSET (offs, SECT_OFF_BSS) = addr;
|
ANOFFSET (offs, SECT_OFF_BSS) = addr;
|
||||||
|
|
||||||
objfile_relocate_data(symfile_objfile, offs);
|
/* Because we only set offsets for DATA and BSS sections, and the other
|
||||||
|
offsets are unchanged from ->section_offsets, the other sections won't
|
||||||
|
get relocated. */
|
||||||
|
objfile_relocate (symfile_objfile, offs);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
113
gdb/stabsread.c
113
gdb/stabsread.c
|
@ -198,8 +198,36 @@ static int undef_types_length;
|
||||||
if (**(pp) == '\\' || (**(pp) == '?' && (*(pp))[1] == '\0')) \
|
if (**(pp) == '\\' || (**(pp) == '?' && (*(pp))[1] == '\0')) \
|
||||||
*(pp) = next_symbol_text (); \
|
*(pp) = next_symbol_text (); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
/* FIXME: These probably should be our own types (like rs6000_builtin_type
|
||||||
|
has its own types) rather than builtin_type_*. */
|
||||||
|
static struct type **os9k_type_vector[] = {
|
||||||
|
0,
|
||||||
|
&builtin_type_int,
|
||||||
|
&builtin_type_char,
|
||||||
|
&builtin_type_long,
|
||||||
|
&builtin_type_short,
|
||||||
|
&builtin_type_unsigned_char,
|
||||||
|
&builtin_type_unsigned_short,
|
||||||
|
&builtin_type_unsigned_long,
|
||||||
|
&builtin_type_unsigned_int,
|
||||||
|
&builtin_type_float,
|
||||||
|
&builtin_type_double,
|
||||||
|
&builtin_type_void,
|
||||||
|
&builtin_type_long_double
|
||||||
|
};
|
||||||
|
|
||||||
|
static void os9k_init_type_vector PARAMS ((struct type **));
|
||||||
|
|
||||||
|
static void
|
||||||
|
os9k_init_type_vector(tv)
|
||||||
|
struct type **tv;
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i=0; i<sizeof(os9k_type_vector)/sizeof(struct type **); i++)
|
||||||
|
tv[i] = (os9k_type_vector[i] == 0 ? 0 : *(os9k_type_vector[i]));
|
||||||
|
}
|
||||||
|
|
||||||
/* Look up a dbx type-number pair. Return the address of the slot
|
/* Look up a dbx type-number pair. Return the address of the slot
|
||||||
where the type for that number-pair is stored.
|
where the type for that number-pair is stored.
|
||||||
The number-pair is in TYPENUMS.
|
The number-pair is in TYPENUMS.
|
||||||
|
@ -265,6 +293,10 @@ Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
|
||||||
(type_vector_length * sizeof (struct type *)));
|
(type_vector_length * sizeof (struct type *)));
|
||||||
memset (&type_vector[old_len], 0,
|
memset (&type_vector[old_len], 0,
|
||||||
(type_vector_length - old_len) * sizeof (struct type *));
|
(type_vector_length - old_len) * sizeof (struct type *));
|
||||||
|
|
||||||
|
if (os9k_stabs)
|
||||||
|
/* Deal with OS9000 fundamental types. */
|
||||||
|
os9k_init_type_vector (type_vector);
|
||||||
}
|
}
|
||||||
return (&type_vector[index]);
|
return (&type_vector[index]);
|
||||||
}
|
}
|
||||||
|
@ -1100,7 +1132,10 @@ define_symbol (valu, string, desc, type, objfile)
|
||||||
SYMBOL_CLASS (sym) = LOC_STATIC;
|
SYMBOL_CLASS (sym) = LOC_STATIC;
|
||||||
SYMBOL_VALUE_ADDRESS (sym) = valu;
|
SYMBOL_VALUE_ADDRESS (sym) = valu;
|
||||||
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
|
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
|
||||||
add_symbol_to_list (sym, &local_symbols);
|
if (os9k_stabs)
|
||||||
|
add_symbol_to_list (sym, &global_symbols);
|
||||||
|
else
|
||||||
|
add_symbol_to_list (sym, &local_symbols);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
|
@ -1482,16 +1517,36 @@ read_type (pp, objfile)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f': /* Function returning another type */
|
case 'f': /* Function returning another type */
|
||||||
|
if (os9k_stabs && **pp == '(')
|
||||||
|
{
|
||||||
|
/* Function prototype; skip it.
|
||||||
|
We must conditionalize this on os9k_stabs because otherwise
|
||||||
|
it could be confused with a Sun-style (1,3) typenumber
|
||||||
|
(I think). */
|
||||||
|
while (**pp != ')')
|
||||||
|
++*pp;
|
||||||
|
++*pp;
|
||||||
|
}
|
||||||
type1 = read_type (pp, objfile);
|
type1 = read_type (pp, objfile);
|
||||||
type = make_function_type (type1, dbx_lookup_type (typenums));
|
type = make_function_type (type1, dbx_lookup_type (typenums));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'k': /* Const qualifier on some type (Sun) */
|
case 'k': /* Const qualifier on some type (Sun) */
|
||||||
|
case 'c': /* Const qualifier on some type (OS9000) */
|
||||||
|
/* Because 'c' means other things to AIX and 'k' is perfectly good,
|
||||||
|
only accept 'c' in the os9k_stabs case. */
|
||||||
|
if (type_descriptor == 'c' && !os9k_stabs)
|
||||||
|
return error_type (pp);
|
||||||
type = read_type (pp, objfile);
|
type = read_type (pp, objfile);
|
||||||
/* FIXME! For now, we ignore const and volatile qualifiers. */
|
/* FIXME! For now, we ignore const and volatile qualifiers. */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'B': /* Volatile qual on some type (Sun) */
|
case 'B': /* Volatile qual on some type (Sun) */
|
||||||
|
case 'i': /* Volatile qual on some type (OS9000) */
|
||||||
|
/* Because 'i' means other things to AIX and 'B' is perfectly good,
|
||||||
|
only accept 'i' in the os9k_stabs case. */
|
||||||
|
if (type_descriptor == 'i' && !os9k_stabs)
|
||||||
|
return error_type (pp);
|
||||||
type = read_type (pp, objfile);
|
type = read_type (pp, objfile);
|
||||||
/* FIXME! For now, we ignore const and volatile qualifiers. */
|
/* FIXME! For now, we ignore const and volatile qualifiers. */
|
||||||
break;
|
break;
|
||||||
|
@ -1552,10 +1607,17 @@ read_type (pp, objfile)
|
||||||
*dbx_lookup_type (typenums) = type;
|
*dbx_lookup_type (typenums) = type;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'b': /* Sun ACC builtin int type */
|
case 'b':
|
||||||
type = read_sun_builtin_type (pp, typenums, objfile);
|
if (os9k_stabs)
|
||||||
if (typenums[0] != -1)
|
/* Const and volatile qualified type. */
|
||||||
*dbx_lookup_type (typenums) = type;
|
type = read_type (pp, objfile);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Sun ACC builtin int type */
|
||||||
|
type = read_sun_builtin_type (pp, typenums, objfile);
|
||||||
|
if (typenums[0] != -1)
|
||||||
|
*dbx_lookup_type (typenums) = type;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'R': /* Sun ACC builtin float type */
|
case 'R': /* Sun ACC builtin float type */
|
||||||
|
@ -2825,24 +2887,29 @@ read_array_type (pp, type, objfile)
|
||||||
int nbits;
|
int nbits;
|
||||||
|
|
||||||
/* Format of an array type:
|
/* Format of an array type:
|
||||||
"ar<index type>;lower;upper;<array_contents_type>". Put code in
|
"ar<index type>;lower;upper;<array_contents_type>".
|
||||||
to handle this.
|
OS9000: "arlower,upper;<array_contents_type>".
|
||||||
|
|
||||||
Fortran adjustable arrays use Adigits or Tdigits for lower or upper;
|
Fortran adjustable arrays use Adigits or Tdigits for lower or upper;
|
||||||
for these, produce a type like float[][]. */
|
for these, produce a type like float[][]. */
|
||||||
|
|
||||||
index_type = read_type (pp, objfile);
|
if (os9k_stabs)
|
||||||
if (**pp != ';')
|
index_type = builtin_type_int;
|
||||||
/* Improper format of array type decl. */
|
else
|
||||||
return error_type (pp);
|
{
|
||||||
++*pp;
|
index_type = read_type (pp, objfile);
|
||||||
|
if (**pp != ';')
|
||||||
|
/* Improper format of array type decl. */
|
||||||
|
return error_type (pp);
|
||||||
|
++*pp;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(**pp >= '0' && **pp <= '9') && **pp != '-')
|
if (!(**pp >= '0' && **pp <= '9') && **pp != '-')
|
||||||
{
|
{
|
||||||
(*pp)++;
|
(*pp)++;
|
||||||
adjustable = 1;
|
adjustable = 1;
|
||||||
}
|
}
|
||||||
lower = read_huge_number (pp, ';', &nbits);
|
lower = read_huge_number (pp, os9k_stabs ? ',' : ';', &nbits);
|
||||||
if (nbits != 0)
|
if (nbits != 0)
|
||||||
return error_type (pp);
|
return error_type (pp);
|
||||||
|
|
||||||
|
@ -2902,6 +2969,7 @@ read_enum_type (pp, type, objfile)
|
||||||
struct pending **symlist;
|
struct pending **symlist;
|
||||||
struct pending *osyms, *syms;
|
struct pending *osyms, *syms;
|
||||||
int o_nsyms;
|
int o_nsyms;
|
||||||
|
int nbits;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* FIXME! The stabs produced by Sun CC merrily define things that ought
|
/* FIXME! The stabs produced by Sun CC merrily define things that ought
|
||||||
|
@ -2915,12 +2983,21 @@ read_enum_type (pp, type, objfile)
|
||||||
osyms = *symlist;
|
osyms = *symlist;
|
||||||
o_nsyms = osyms ? osyms->nsyms : 0;
|
o_nsyms = osyms ? osyms->nsyms : 0;
|
||||||
|
|
||||||
|
if (os9k_stabs)
|
||||||
|
{
|
||||||
|
/* Size. Perhaps this does not have to be conditionalized on
|
||||||
|
os9k_stabs (assuming the name of an enum constant can't start
|
||||||
|
with a digit). */
|
||||||
|
read_huge_number (pp, 0, &nbits);
|
||||||
|
if (nbits != 0)
|
||||||
|
return error_type (pp);
|
||||||
|
}
|
||||||
|
|
||||||
/* Read the value-names and their values.
|
/* Read the value-names and their values.
|
||||||
The input syntax is NAME:VALUE,NAME:VALUE, and so on.
|
The input syntax is NAME:VALUE,NAME:VALUE, and so on.
|
||||||
A semicolon or comma instead of a NAME means the end. */
|
A semicolon or comma instead of a NAME means the end. */
|
||||||
while (**pp && **pp != ';' && **pp != ',')
|
while (**pp && **pp != ';' && **pp != ',')
|
||||||
{
|
{
|
||||||
int nbits;
|
|
||||||
STABS_CONTINUE (pp);
|
STABS_CONTINUE (pp);
|
||||||
p = *pp;
|
p = *pp;
|
||||||
while (*p != ':') p++;
|
while (*p != ':') p++;
|
||||||
|
@ -3766,6 +3843,8 @@ void start_stabs ()
|
||||||
|
|
||||||
/* FIXME: If common_block_name is not already NULL, we should complain(). */
|
/* FIXME: If common_block_name is not already NULL, we should complain(). */
|
||||||
common_block_name = NULL;
|
common_block_name = NULL;
|
||||||
|
|
||||||
|
os9k_stabs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call after end_symtab() */
|
/* Call after end_symtab() */
|
||||||
|
|
|
@ -163,6 +163,8 @@ end_stabs PARAMS ((void));
|
||||||
extern void
|
extern void
|
||||||
finish_global_stabs PARAMS ((struct objfile *objfile));
|
finish_global_stabs PARAMS ((struct objfile *objfile));
|
||||||
|
|
||||||
|
EXTERN int os9k_stabs;
|
||||||
|
|
||||||
/* Functions exported by dbxread.c. These are not in stabsread.h because
|
/* Functions exported by dbxread.c. These are not in stabsread.h because
|
||||||
they are only used by some stabs readers. */
|
they are only used by some stabs readers. */
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Global variables owned by this file */
|
/* Global variables owned by this file */
|
||||||
CORE_ADDR text_relocation = 0; /* text_relocation */
|
|
||||||
int readnow_symbol_files; /* Read full symbols immediately */
|
int readnow_symbol_files; /* Read full symbols immediately */
|
||||||
|
|
||||||
struct complaint oldsyms_complaint = {
|
struct complaint oldsyms_complaint = {
|
||||||
|
@ -632,6 +631,7 @@ symbol_file_command (args, from_tty)
|
||||||
{
|
{
|
||||||
char **argv;
|
char **argv;
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
|
CORE_ADDR text_relocation = 0; /* text_relocation */
|
||||||
struct cleanup *cleanups;
|
struct cleanup *cleanups;
|
||||||
int mapped = 0;
|
int mapped = 0;
|
||||||
int readnow = 0;
|
int readnow = 0;
|
||||||
|
@ -675,23 +675,7 @@ symbol_file_command (args, from_tty)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *p;
|
|
||||||
|
|
||||||
name = *argv;
|
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++;
|
argv++;
|
||||||
}
|
}
|
||||||
|
@ -700,6 +684,25 @@ symbol_file_command (args, from_tty)
|
||||||
{
|
{
|
||||||
error ("no symbol file name was specified");
|
error ("no symbol file name was specified");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
/* If target_link can find out where the file is,
|
||||||
|
more power to it. */
|
||||||
|
p = strrchr (name, '/');
|
||||||
|
if (p != NULL) p++;
|
||||||
|
else p = name;
|
||||||
|
|
||||||
|
target_link (p, &text_relocation);
|
||||||
|
if (text_relocation == (CORE_ADDR)-1)
|
||||||
|
text_relocation = 0;
|
||||||
|
|
||||||
|
symbol_file_add (name, from_tty, text_relocation, 1, mapped,
|
||||||
|
readnow);
|
||||||
|
set_initial_language ();
|
||||||
|
}
|
||||||
|
|
||||||
do_cleanups (cleanups);
|
do_cleanups (cleanups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue