X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fhppa-tdep.c;h=cbdcd90d9270fb7c33f61b7d365ffbf941da7571;hb=49f964133f28d88464f0f1febc4bb34487f72e83;hp=10ac7ecde152e67dbd80e6160b80c64bbc4f8a6f;hpb=d037d08851dcb4ce4feb713a7f024ebac5d84cca;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 10ac7ecde1..cbdcd90d92 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -68,10 +68,6 @@ const struct objfile_data *hppa_objfile_priv_data = NULL; #define UNWIND_ENTRY_SIZE 16 #define STUB_UNWIND_ENTRY_SIZE 8 -/* FIXME: brobecker 2002-11-07: We will likely be able to make the - following functions static, once we hppa is partially multiarched. */ -int hppa_pc_requires_run_before_use (CORE_ADDR pc); - /* Routines to extract various sized constants out of hppa instructions. */ @@ -575,7 +571,7 @@ hppa_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc) } static const unsigned char * -hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len) +hppa_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, int *len) { static const unsigned char breakpoint[] = {0x00, 0x01, 0x00, 0x04}; (*len) = sizeof (breakpoint); @@ -585,7 +581,7 @@ hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len) /* Return the name of a register. */ static const char * -hppa32_register_name (int i) +hppa32_register_name (struct gdbarch *gdbarch, int i) { static char *names[] = { "flags", "r1", "rp", "r3", @@ -628,7 +624,7 @@ hppa32_register_name (int i) } static const char * -hppa64_register_name (int i) +hppa64_register_name (struct gdbarch *gdbarch, int i) { static char *names[] = { "flags", "r1", "rp", "r3", @@ -1813,6 +1809,7 @@ struct hppa_frame_cache static struct hppa_frame_cache * hppa_frame_cache (struct frame_info *next_frame, void **this_cache) { + struct gdbarch *gdbarch = get_frame_arch (next_frame); struct hppa_frame_cache *cache; long saved_gr_mask; long saved_fr_mask; @@ -2106,7 +2103,7 @@ hppa_frame_cache (struct frame_info *next_frame, void **this_cache) saved. The entry SP value is saved at this frame's SP address. */ cache->base = read_memory_integer - (this_sp, gdbarch_ptr_bit (current_gdbarch) / 8); + (this_sp, gdbarch_ptr_bit (gdbarch) / 8); if (hppa_debug) fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [saved]", @@ -2185,7 +2182,7 @@ hppa_frame_cache (struct frame_info *next_frame, void **this_cache) { /* Convert all the offsets into addresses. */ int reg; - for (reg = 0; reg < gdbarch_num_regs (current_gdbarch); reg++) + for (reg = 0; reg < gdbarch_num_regs (gdbarch); reg++) { if (trad_frame_addr_p (cache->saved_regs, reg)) cache->saved_regs[reg].addr += cache->base; @@ -2193,10 +2190,8 @@ hppa_frame_cache (struct frame_info *next_frame, void **this_cache) } { - struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; - gdbarch = get_frame_arch (next_frame); tdep = gdbarch_tdep (gdbarch); if (tdep->unwind_adjust_stub) @@ -2461,7 +2456,7 @@ hppa_stub_unwind_sniffer (struct frame_info *next_frame) if (pc == 0 || (tdep->in_solib_call_trampoline != NULL && tdep->in_solib_call_trampoline (pc, NULL)) - || gdbarch_in_solib_return_trampoline (current_gdbarch, pc, NULL)) + || gdbarch_in_solib_return_trampoline (gdbarch, pc, NULL)) return &hppa_stub_frame_unwind; return NULL; } @@ -2612,34 +2607,6 @@ unwind_command (char *exp, int from_tty) } } -int -hppa_pc_requires_run_before_use (CORE_ADDR pc) -{ - /* Sometimes we may pluck out a minimal symbol that has a negative address. - - An example of this occurs when an a.out is linked against a foo.sl. - The foo.sl defines a global bar(), and the a.out declares a signature - for bar(). However, the a.out doesn't directly call bar(), but passes - its address in another call. - - If you have this scenario and attempt to "break bar" before running, - gdb will find a minimal symbol for bar() in the a.out. But that - symbol's address will be negative. What this appears to denote is - an index backwards from the base of the procedure linkage table (PLT) - into the data linkage table (DLT), the end of which is contiguous - with the start of the PLT. This is clearly not a valid address for - us to set a breakpoint on. - - Note that one must be careful in how one checks for a negative address. - 0xc0000000 is a legitimate address of something in a shared text - segment, for example. Since I don't know what the possible range - is of these "really, truly negative" addresses that come from the - minimal symbols, I'm resorting to the gross hack of checking the - top byte of the address for all 1's. Sigh. */ - - return (!target_has_stack && (pc & 0xFF000000) == 0xFF000000); -} - /* Return the GDB type object for the "standard" data type of data in register REGNUM. */ @@ -3195,9 +3162,9 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } static void -hppa_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) +hppa_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); fprintf_unfiltered (file, "bytes_per_address = %d\n", tdep->bytes_per_address);