#define L_INCR 1
#endif
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
/* We don't want to use HP-UX's nlists. */
#define _NLIST_INCLUDED
#endif
#include "target.h"
#include "gdbcore.h" /* for bfd stuff */
#include "libbfd.h" /* FIXME Secret internal BFD stuff (bfd_read) */
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
#include "libhppa.h"
#include "syms.h"
#else
#include "stabsread.h"
#include "gdb-stabs.h"
#include "demangle.h"
+#include "language.h" /* Needed inside partial-stab.h */
+#include "complaints.h"
#include "aout/aout64.h"
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native, now */
add_this_object_header_file (i);
return;
}
- complain (&repeated_header_complaint, (char *)symnum);
+ complain (&repeated_header_complaint, symnum);
complain (&repeated_header_name_complaint, name);
}
if (mainline || objfile->global_psymbols.size == 0 || objfile->static_psymbols.size == 0)
init_psymbol_list (objfile);
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
symbol_size = obj_dbx_symbol_entry_size (sym_bfd);
#else
symbol_size = DBX_SYMBOL_SIZE (objfile);
xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
/* FIXME POKING INSIDE BFD DATA STRUCTURES */
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
#define STRING_TABLE_OFFSET (sym_bfd->origin + obj_dbx_str_filepos (sym_bfd))
#define SYMBOL_TABLE_OFFSET (sym_bfd->origin + obj_dbx_sym_filepos (sym_bfd))
#define HP_STRING_TABLE_OFFSET (sym_bfd->origin + obj_hp_str_filepos (sym_bfd))
if (!DBX_TEXT_SECT (objfile))
error ("Can't find .text section in symbol file");
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
HP_SYMCOUNT (objfile) = obj_hp_sym_count (sym_bfd);
DBX_SYMCOUNT (objfile) = obj_dbx_sym_count (sym_bfd);
#else
however at least check to see if the size is zero or some negative
value. */
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
DBX_STRINGTAB_SIZE (objfile) = obj_dbx_stringtab_size (sym_bfd);
HP_STRINGTAB_SIZE (objfile) = obj_hp_stringtab_size (sym_bfd);
#else
DBX_STRINGTAB (objfile) =
(char *) obstack_alloc (&objfile -> psymbol_obstack,
DBX_STRINGTAB_SIZE (objfile));
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
if (HP_STRINGTAB_SIZE (objfile) <= 0)
error ("ridiculous string table size (%d bytes).",
HP_STRINGTAB_SIZE (objfile));
sym_bfd);
if (val != DBX_STRINGTAB_SIZE (objfile))
perror_with_name (name);
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
val = bfd_seek (sym_bfd, HP_STRING_TABLE_OFFSET, L_SET);
if (val < 0)
perror_with_name (name);
if (val != HP_STRINGTAB_SIZE (objfile))
perror_with_name (name);
#endif
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
HP_SYMTAB_OFFSET (objfile) = HP_SYMBOL_TABLE_OFFSET;
#endif
}
symbuf_end = nbytes / symbol_size;
symbuf_idx = 0;
}
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
/* same as above for the HP symbol table */
static struct symbol_dictionary_record hp_symbuf[4096];
/* Current best guess is that there are approximately a twentieth
of the total symbols (in a debugging file) are global or static
oriented symbols */
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
objfile -> global_psymbols.size = (DBX_SYMCOUNT (objfile) +
HP_SYMCOUNT (objfile)) / 10;
objfile -> static_psymbols.size = (DBX_SYMCOUNT (objfile) +
CORE_ADDR last_o_file_start = 0;
struct cleanup *old_chain;
bfd *abfd;
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
/* HP stuff */
struct symbol_dictionary_record *hp_bufp;
int hp_symnum;
file_string_table_offset = 0;
next_file_string_table_offset = 0;
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
stringtab_global = HP_STRINGTAB (objfile);
#else
stringtab_global = DBX_STRINGTAB (objfile);
symbuf_end = symbuf_idx = 0;
next_symbol_text_func = dbx_next_symbol_text;
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
/* On pa machines, the global symbols are all in the regular HP-UX
symbol table. Read them in first. */
hp_symbuf_end = hp_symbuf_idx = 0;
- bfd_seek (abfd, HP_SYMTAB_OFFSET (objfile), 0);
+ bfd_seek (abfd, HP_SYMTAB_OFFSET (objfile), L_SET);
for (hp_symnum = 0; hp_symnum < HP_SYMCOUNT (objfile); hp_symnum++)
{
objfile);
}
}
- bfd_seek (abfd, DBX_SYMTAB_OFFSET (objfile), 0);
+ bfd_seek (abfd, DBX_SYMTAB_OFFSET (objfile), L_SET);
#endif
for (symnum = 0; symnum < DBX_SYMCOUNT (objfile); symnum++)
#define SET_NAMESTRING()\
if (((unsigned)bufp->n_strx + file_string_table_offset) >= \
DBX_STRINGTAB_SIZE (objfile)) { \
- complain (&string_table_offset_complaint, (char *) symnum); \
+ complain (&string_table_offset_complaint, symnum); \
namestring = "foo"; \
} else \
namestring = bufp->n_strx + file_string_table_offset + \
}
/* If there's stuff to be cleaned up, clean it up. */
-#ifndef hp9000s800
+#ifndef GDB_TARGET_IS_HPPA
if (DBX_SYMCOUNT (objfile) > 0 /* We have some syms */
/*FIXME, does this have a bug at start address 0? */
&& last_o_file_start
if (pst)
{
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
end_psymtab (pst, psymtab_include_list, includes_used,
symnum * symbol_size, dbsubc_addr,
dependency_list, dependencies_used);
buildsym_init ();
old_chain = make_cleanup (really_free_pendings, 0);
file_string_table_offset = FILE_STRING_OFFSET (pst);
-#ifdef hp9000s800
- symbol_size = obj_dbx_symbol_entry_size (sym_bfd);
+#ifdef GDB_TARGET_IS_HPPA
+ symbol_size = obj_dbx_symbol_entry_size (pst->objfile->obfd);
#else
symbol_size = SYMBOL_SIZE (pst);
#endif
current_objfile = objfile;
subfile_stack = NULL;
-#ifdef hp9000s800
+#ifdef GDB_TARGET_IS_HPPA
stringtab_global = HP_STRINGTAB (objfile);
#else
stringtab_global = DBX_STRINGTAB (objfile);
SET_NAMESTRING ();
- processing_gcc_compilation =
- (bufp->n_type == N_TEXT
- && (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0
- || strcmp(namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0));
+ processing_gcc_compilation = 0;
+ if (bufp->n_type == N_TEXT)
+ {
+ if (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0)
+ processing_gcc_compilation = 1;
+ else if (strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0)
+ processing_gcc_compilation = 2;
+ }
/* Try to select a C++ demangling based on the compilation unit
producer. */
if (processing_gcc_compilation)
{
#if 1 /* Works, but is experimental. -fnf */
- if (current_demangling_style == auto_demangling)
+ if (AUTO_DEMANGLING)
{
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
}
}
/* We skip checking for a new .o or -l file; that should never
happen in this routine. */
- else if (type == N_TEXT
- && (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0
- || strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0))
+ else if (type == N_TEXT)
{
/* I don't think this code will ever be executed, because
the GCC_COMPILED_FLAG_SYMBOL usually is right before
the N_SO symbol which starts this source file.
However, there is no reason not to accept
the GCC_COMPILED_FLAG_SYMBOL anywhere. */
- processing_gcc_compilation = 1;
+
+ if (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0)
+ processing_gcc_compilation = 1;
+ else if (strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0)
+ processing_gcc_compilation = 2;
+
#if 1 /* Works, but is experimental. -fnf */
- if (current_demangling_style == auto_demangling)
+ if (AUTO_DEMANGLING)
{
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
}
static CORE_ADDR function_start_offset;
char *colon_pos;
+#ifndef BLOCK_ADDRESS_FUNCTION_RELATIVE
+ /* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the
+ function start address, so just use the text offset. */
+ function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
+#endif
+
/* Something is wrong if we see real data before
seeing a source file name. */
absolute, or relative to the N_SO, depending on
BLOCK_ADDRESS_ABSOLUTE. */
function_start_offset = valu;
-#else
- /* Default on ordinary systems */
- function_start_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
#endif
within_function = 1;
}
/* Stack must be empty now. */
if (context_stack_depth != 0)
- complain (&lbrac_unmatched_complaint, (char *) symnum);
+ complain (&lbrac_unmatched_complaint, symnum);
new = push_context (0, valu);
new->name = define_symbol (valu, name, desc, type, objfile);
#ifndef SUN_FIXED_LBRAC_BUG
if (valu < last_pc_address) {
/* Patch current LBRAC pc value to match last handy pc value */
- complain (&lbrac_complaint, 0);
+ complain (&lbrac_complaint);
valu = last_pc_address;
}
#endif
new = pop_context();
if (desc != new->depth)
- complain (&lbrac_mismatch_complaint, (char *) symnum);
+ complain (&lbrac_mismatch_complaint, symnum);
/* Some compilers put the variable decls inside of an
LBRAC/RBRAC block. This macro should be nonzero if this
/* FIXME Muzzle a compiler bug that makes end < start. */
if (new->start_addr > valu)
{
- complain(&lbrac_rbrac_complaint, 0);
+ complain (&lbrac_rbrac_complaint);
new->start_addr = valu;
}
/* Make a block for the local symbols within. */
case N_OPT: /* Solaris 2: Compiler options */
if (name)
{
- if (!strcmp (name, GCC2_COMPILED_FLAG_SYMBOL))
+ if (strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0)
{
- processing_gcc_compilation = 1;
+ processing_gcc_compilation = 2;
#if 1 /* Works, but is experimental. -fnf */
- if (current_demangling_style == auto_demangling)
+ if (AUTO_DEMANGLING)
{
set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
}
adjusted for elf details. */
void
-DEFUN(elfstab_build_psymtabs, (objfile, section_offsets, mainline,
+elfstab_build_psymtabs (objfile, section_offsets, mainline,
staboffset, stabsize,
- stabstroffset, stabstrsize),
- struct objfile *objfile AND
- struct section_offsets *section_offsets AND
- int mainline AND
- unsigned int staboffset AND
- unsigned int stabsize AND
- unsigned int stabstroffset AND
- unsigned int stabstrsize)
+ stabstroffset, stabstrsize)
+ struct objfile *objfile;
+ struct section_offsets *section_offsets;
+ int mainline;
+ file_ptr staboffset;
+ unsigned int stabsize;
+ file_ptr stabstroffset;
+ unsigned int stabstrsize;
{
int val;
bfd *sym_bfd = objfile->obfd;