+Sat Sep 26 02:07:31 1992 John Gilmore (gnu@cygnus.com)
+
+ * findvar.c (supply_register): Add CLEAN_UP_REGISTER_VALUE hook.
+ * tm-hppa.h (CLEAN_UP_REGISTER_VALUE): Use it.
+ * hppa-coredep.c: Remove, now that we use the hook.
+ * config/hppab.mh, config/hppah.mh: Use standard coredep.o.
+ * hppab-xdep.c, hppah-xdep.c: Remove custom code, use hook.
+
+ * dbxread.c, partial-stab.h: Replace all #ifdef hp9000s800's with
+ GDB_TARGET_IS_HPPA's. This is a SERIOUS KLUDGE. The code needs to all
+ be ripped out and reimplemented right (see elfread.c).
+ * tm-hppa.h (GDB_TARGET_IS_HPPA): Define.
+
+ Rename all HPPA files to fit into unique DOS filenames:
+ * *hppabsd* => *hppab*
+ * *hppahpux* => *hppah*
+
Sat Sep 26 00:25:15 1992 John Gilmore (gnu@cygnus.com)
Make the /proc support a target-struct in its own right.
#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
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. */
}
/* 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);
#define PC_REGNUM PCOQ_HEAD_REGNUM
#define NPC_REGNUM PCOQ_TAIL_REGNUM
+/* When fetching register values from an inferior or a core file,
+ clean them up using this macro. BUF is a char pointer to
+ the raw value of the register in the registers[] array. */
+
+#define CLEAN_UP_REGISTER_VALUE(regno, buf) \
+ do { \
+ if ((regno) == PCOQ_HEAD_REGNUM || (regno) == PCOQ_TAIL_REGNUM) \
+ (buf)[3] &= ~0x3; \
+ } while (0)
+
/* Define DO_REGISTERS_INFO() to do machine-specific formatting
of register dumps. */
dummyname[13] = deposit_14 (sr4export_address & MASK_11, dummyname[13]);\
}
+
+#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
+ sp = hp_push_arguments(nargs, args, sp, struct_return, struct_addr)
+
/* Write the PC to a random value.
On PA-RISC, we need to be sure that the PC space queue is correct. */
write_register (PCSQ_HEAD_REGNUM, space_val); \
write_register (PCOQ_TAIL_REGNUM, addr); \
write_register (PCSQ_TAIL_REGNUM, space_val);}
+
+/* Symbol files have two symbol tables. Rather than do this right,
+ like the ELF symbol reading code, massive hackery was added
+ to dbxread.c and partial-stab.h. This flag turns on that
+ hackery, which should all go away FIXME FIXME FIXME FIXME now. */
+
+#define GDB_TARGET_IS_HPPA