From: John Gilmore Date: Sat, 26 Sep 1992 10:24:26 +0000 (+0000) Subject: * findvar.c (supply_register): Add CLEAN_UP_REGISTER_VALUE hook. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e0ba1d1427d48b62a92a475ffe15eca42376b49a;p=binutils-gdb.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2b0e8c7dd75..2c80adf051e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,20 @@ +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. diff --git a/gdb/dbxread.c b/gdb/dbxread.c index c14d865341e..c6935d7ced7 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -41,7 +41,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #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 @@ -59,7 +59,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #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 @@ -464,7 +464,7 @@ dbx_symfile_read (objfile, section_offsets, mainline) 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); @@ -537,7 +537,7 @@ dbx_symfile_init (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)) @@ -553,7 +553,7 @@ dbx_symfile_init (objfile) 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 @@ -574,7 +574,7 @@ dbx_symfile_init (objfile) 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 @@ -596,7 +596,7 @@ dbx_symfile_init (objfile) 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)); @@ -615,7 +615,7 @@ dbx_symfile_init (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); @@ -624,7 +624,7 @@ dbx_symfile_init (objfile) 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 } @@ -680,7 +680,7 @@ fill_symbuf (sym_bfd) 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]; @@ -746,7 +746,7 @@ init_psymbol_list (objfile) /* 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) + @@ -846,7 +846,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size) 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; @@ -875,7 +875,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size) 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); @@ -914,7 +914,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size) 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. */ @@ -1036,7 +1036,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size) } /* 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 @@ -1050,7 +1050,7 @@ read_dbx_symtab (section_offsets, objfile, text_addr, text_size) 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); @@ -1346,8 +1346,8 @@ dbx_psymtab_to_symtab_1 (pst) 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 @@ -1442,7 +1442,7 @@ read_ofile_symtab (objfile, sym_offset, sym_size, text_offset, text_size, current_objfile = objfile; subfile_stack = NULL; -#ifdef hp9000s800 +#ifdef GDB_TARGET_IS_HPPA stringtab_global = HP_STRINGTAB (objfile); #else stringtab_global = DBX_STRINGTAB (objfile); diff --git a/gdb/partial-stab.h b/gdb/partial-stab.h index 9af5b8d34b2..5b36a251fc3 100644 --- a/gdb/partial-stab.h +++ b/gdb/partial-stab.h @@ -78,13 +78,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ if ((namestring[0] == '-' && namestring[1] == 'l') || (namestring [(nsl = strlen (namestring)) - 1] == 'o' && namestring [nsl - 2] == '.') -#ifdef hp9000s800 +#ifdef GDB_TARGET_IS_HPPA /* some cooperation from gcc to get around ld stupidity */ || (namestring[0] == 'e' && !strcmp (namestring, "end_file.")) #endif ) { -#ifndef hp9000s800 +#ifndef GDB_TARGET_IS_HPPA if (objfile -> ei.entry_point < CUR_SYMBOL_VALUE && objfile -> ei.entry_point >= last_o_file_start) { diff --git a/gdb/tm-hppa.h b/gdb/tm-hppa.h index 9d6008d64fc..7b672a5a47c 100644 --- a/gdb/tm-hppa.h +++ b/gdb/tm-hppa.h @@ -167,6 +167,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #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. */ @@ -536,6 +546,10 @@ text_space ; Otherwise, go through _sr4export, 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. */ @@ -553,3 +567,10 @@ text_space ; Otherwise, go through _sr4export, 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