summaryrefslogtreecommitdiff
path: root/gdb/hpread.c
diff options
context:
space:
mode:
authorRandolph Chung <tausq@debian.org>2004-04-17 17:19:29 +0000
committerRandolph Chung <tausq@debian.org>2004-04-17 17:19:29 +0000
commit07d15647e431ede17f370416570c24beea88ab38 (patch)
tree3ce0b68b7f4278f905bef3ba7ec5b6173a7fe67a /gdb/hpread.c
parentef36d80dff23b357be411bc068c119b6231de7b6 (diff)
downloadgdb-07d15647e431ede17f370416570c24beea88ab38.tar.gz
2004-04-17 Randolph Chung <tausq@debian.org>
* Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h) * hppa-tdep.c (hppa_objfile_priv_data): New. (SR4EXPORT_LDIL_OFFSET, SR4EXPORT_LDO_OFFSET): Use HPPA_INSTRUCTION_SIZE. (read_unwind_info): Use objfile_data to reference unwind info. (find_unwind_entry): Likewise. (hpread_adjust_stack_address): Move to hpread.c. (_initialize_hppa_tdep): Register hppa objfile data. * hppa-tdep.h (HPPA_INSTRUCTION_SIZE): Define. (unwind_table_entry, unwind_stub_types): Move from tm-hppa.h. (obj_unwind_info, obj_private_struct): Move from tm-hppa.h, and rename with hppa_ prefix. * hpread.c (hppa-tdep.h): Include. (hpread_adjust_stack_address): Move from hppa-tdep.c. (hpread_read_function_type, hpread_read_doc_function_type) (hpread_process_one_debug_symbol): Call hpread_adjust_stack_address directly. Use objfile_data to access solib data. * pa64solib.c (hppa-tdep.h): Include. (pa64_solib_add_solib_objfile): Use objfile_data to access solib data. * somsolib.c (hppa-tdep.h): Include. (som_solib_add_solib_objfile): Use objfile_data to access solib data. * config/pa/tm-hppa.h (frame_info, frame_saved_regs, value, type) (inferior_status): Remove unused forward declarations. (INSTRUCTION_SIZE): Move to hppa-tdep.c. (unwind_table_entry, unwind_stub_types, obj_unwind_info) (obj_private_struct): Move to hppa-tdep.h. (HPREAD_ADJUST_STACK_ADDRESS): Remove.
Diffstat (limited to 'gdb/hpread.c')
-rw-r--r--gdb/hpread.c46
1 files changed, 32 insertions, 14 deletions
diff --git a/gdb/hpread.c b/gdb/hpread.c
index 6e922768334..84bf6462692 100644
--- a/gdb/hpread.c
+++ b/gdb/hpread.c
@@ -37,6 +37,7 @@
#include "demangle.h"
#include "somsolib.h"
#include "gdb_assert.h"
+#include "hppa-tdep.h"
/* Private information attached to an objfile which we use to find
and internalize the HP C debug symbols within that objfile. */
@@ -234,6 +235,8 @@ static void fixup_class_method_type
static void hpread_adjust_bitoffsets (struct type *, int);
+static int hpread_adjust_stack_address (CORE_ADDR func_addr);
+
static dnttpointer hpread_get_next_skip_over_anon_unions
(int, dnttpointer, union dnttentry **, struct objfile *);
@@ -3247,10 +3250,9 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
if (paramp->dfparam.copyparam)
{
SYMBOL_VALUE (sym) = paramp->dfparam.location;
-#ifdef HPREAD_ADJUST_STACK_ADDRESS
SYMBOL_VALUE (sym)
- += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
-#endif
+ += hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile));
+
/* This is likely a pass-by-invisible reference parameter,
Hack on the symbol class to make GDB happy. */
/* ??rehrauer: This appears to be broken w/r/t to passing
@@ -3426,10 +3428,9 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
if (paramp->dfparam.copyparam)
{
SYMBOL_VALUE (sym) = paramp->dfparam.location;
-#ifdef HPREAD_ADJUST_STACK_ADDRESS
SYMBOL_VALUE (sym)
- += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
-#endif
+ += hpread_adjust_stack_address(CURRENT_FUNCTION_VALUE (objfile));
+
/* This is likely a pass-by-invisible reference parameter,
Hack on the symbol class to make GDB happy. */
/* ??rehrauer: This appears to be broken w/r/t to passing
@@ -5697,10 +5698,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
if (dn_bufp->dfparam.copyparam)
{
SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
-#ifdef HPREAD_ADJUST_STACK_ADDRESS
SYMBOL_VALUE (sym)
- += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
-#endif
+ += hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile));
}
else
SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
@@ -5754,11 +5753,14 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
* to "somsolib.c". But C lets us point to one.
*/
struct so_list *so;
+ struct hppa_objfile_private *priv;
- if (objfile->obj_private == NULL)
+ priv = (struct hppa_objfile_private *)
+ objfile_data (objfile, hppa_objfile_priv_data);
+ if (priv == NULL)
error ("Internal error in reading shared library information.");
- so = ((obj_private_data_t *) (objfile->obj_private))->so_info;
+ so = ((struct hppa_objfile_private *) priv)->so_info;
if (so == NULL)
error ("Internal error in reading shared library information.");
@@ -5781,10 +5783,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
SYMBOL_CLASS (sym) = LOC_LOCAL;
SYMBOL_VALUE (sym) = dn_bufp->ddvar.location;
-#ifdef HPREAD_ADJUST_STACK_ADDRESS
SYMBOL_VALUE (sym)
- += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
-#endif
+ += hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile));
SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->ddvar.type, objfile);
if (dn_bufp->ddvar.global)
add_symbol_to_list (sym, &global_symbols);
@@ -6264,6 +6264,24 @@ hpread_adjust_bitoffsets (struct type *type, int bits)
TYPE_FIELD_BITPOS (type, i) -= bits;
}
+/* Return the adjustment necessary to make for addresses on the stack
+ as presented by hpread.c.
+
+ This is necessary because of the stack direction on the PA and the
+ bizarre way in which someone (?) decided they wanted to handle
+ frame pointerless code in GDB. */
+int
+hpread_adjust_stack_address (CORE_ADDR func_addr)
+{
+ struct unwind_table_entry *u;
+
+ u = find_unwind_entry (func_addr);
+ if (!u)
+ return 0;
+ else
+ return u->Total_frame_size << 3;
+}
+
/* Because of quirks in HP compilers' treatment of anonymous unions inside
classes, we have to chase through a chain of threaded FIELD entries.
If we encounter an anonymous union in the chain, we must recursively skip over