aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-01-28 16:25:25 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-01-28 16:25:25 +0000
commit9fdb3f7aad80699becae8d400d181a2b924fb0a5 (patch)
tree9e88ae9cbfb39d1fd0af4392525a3ac8fe309bac /gdb
parent0b233d31dfe5919025acff17491ea0ee70491cdc (diff)
downloadgdb-9fdb3f7aad80699becae8d400d181a2b924fb0a5.zip
gdb-9fdb3f7aad80699becae8d400d181a2b924fb0a5.tar.gz
gdb-9fdb3f7aad80699becae8d400d181a2b924fb0a5.tar.bz2
* config/pa/tm-hppa.h: Define macro SMASH_TEXT_ADDRESS.
* elfread.c (record_minimal_symbol_and_info), dwarfread.c (process_dies), paread.c (pa_symtab_read): Use it.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/config/pa/tm-hppa.h13
-rw-r--r--gdb/dwarfread.c5
-rw-r--r--gdb/elfread.c3
-rw-r--r--gdb/paread.c12
5 files changed, 31 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1ebe34a..831c121 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jan 28 10:40:34 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/pa/tm-hppa.h: Define macro SMASH_TEXT_ADDRESS.
+ * elfread.c (record_minimal_symbol_and_info),
+ dwarfread.c (process_dies), paread.c (pa_symtab_read): Use it.
+
Thu Jan 27 15:12:23 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* i386-stub.c: Add ".text" right before "mem_fault:".
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index f2afcc1..4d970ea 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -404,11 +404,14 @@ CORE_ADDR hppa_fix_call_dummy();
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = hppa_push_arguments(nargs, args, sp, struct_return, struct_addr)
-
-/* 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. */
+
+/* The low two bits of the PC on the PA contain the privilege level. Some
+ genius implementing a (non-GCC) compiler apparently decided this means
+ that "addresses" in a text section therefore include a privilege level,
+ and thus symbol tables should contain these bits. This seems like a
+ bonehead thing to do--anyway, it seems to work for our purposes to just
+ ignore those bits. */
+#define SMASH_TEXT_ADDRESS(addr) ((addr) &= ~0x3)
#define GDB_TARGET_IS_HPPA
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index 1d8931a..956fb7e 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -1989,6 +1989,11 @@ process_dies (thisdie, enddie, objfile)
{
nextdie = thisdie + di.die_length;
}
+#ifdef SMASH_TEXT_ADDRESS
+ /* I think that these are always text, not data, addresses. */
+ SMASH_TEXT_ADDRESS (di.at_low_pc);
+ SMASH_TEXT_ADDRESS (di.at_high_pc);
+#endif
switch (di.die_tag)
{
case TAG_compile_unit:
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 9b5b34c..5e8292c 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -190,6 +190,9 @@ record_minimal_symbol_and_info (name, address, ms_type, info, objfile)
case mst_text:
case mst_file_text:
section = SECT_OFF_TEXT;
+#ifdef SMASH_TEXT_ADDRESS
+ SMASH_TEXT_ADDRESS (address);
+#endif
break;
case mst_data:
case mst_file_data:
diff --git a/gdb/paread.c b/gdb/paread.c
index 686bed6..3c4755d 100644
--- a/gdb/paread.c
+++ b/gdb/paread.c
@@ -158,7 +158,9 @@ pa_symtab_read (abfd, addr, objfile)
case ST_MILLICODE:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_text;
- bufp->symbol_value &= ~0x3; /* clear out permission bits */
+#ifdef SMASH_TEXT_ADDRESS
+ SMASH_TEXT_ADDRESS (bufp->symbol_value);
+#endif
break;
case ST_DATA:
symname = bufp->name.n_strx + stringtab;
@@ -183,7 +185,9 @@ pa_symtab_read (abfd, addr, objfile)
case ST_CODE:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_file_text;
- bufp->symbol_value &= ~0x3; /* clear out permission bits */
+#ifdef SMASH_TEXT_ADDRESS
+ SMASH_TEXT_ADDRESS (bufp->symbol_value);
+#endif
check_strange_names:
/* GAS leaves labels in .o files after assembling. At
@@ -207,7 +211,9 @@ pa_symtab_read (abfd, addr, objfile)
case ST_MILLICODE:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_file_text;
- bufp->symbol_value &= ~0x3; /* clear out permission bits */
+#ifdef SMASH_TEXT_ADDRESS
+ SMASH_TEXT_ADDRESS (bufp->symbol_value);
+#endif
break;
case ST_DATA: