X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fhppa-linux-tdep.c;h=c4c169fe98987b79507c83d8f482b032f6cdbc19;hb=a616bb94509c22c96ae8bf1432ec28a7f3e31778;hp=52837ee5552e86791ce4e607bc5c3989e799f151;hpb=50c5eb5335ff58688fd4652a40c791088a94d532;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c index 52837ee555..c4c169fe98 100644 --- a/gdb/hppa-linux-tdep.c +++ b/gdb/hppa-linux-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for GNU/Linux running on PA-RISC, for GDB. - Copyright (C) 2004-2014 Free Software Foundation, Inc. + Copyright (C) 2004-2018 Free Software Foundation, Inc. This file is part of GDB. @@ -39,14 +39,13 @@ static int hppa_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) { /* The general registers and the sar are the same in both sets. */ - if (reg <= 32) + if (reg >= 0 && reg <= 32) return reg; /* fr4-fr31 (left and right halves) are mapped from 72. */ if (reg >= 72 && reg <= 72 + 28 * 2) return HPPA_FP4_REGNUM + (reg - 72); - warning (_("Unmapped DWARF DBX Register #%d encountered."), reg); return -1; } @@ -136,7 +135,7 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) { unsigned int dummy[HPPA_MAX_INSN_PATTERN_LEN]; int offs = 0; - int try; + int attempt; /* offsets to try to find the trampoline */ static int pcoffs[] = { 0, 4*4, 5*4 }; /* offsets to the rt_sigframe structure */ @@ -154,12 +153,12 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) e4008200 be,l 0x100(%sr2, %r0), %sr0, %r31 08000240 nop */ - for (try = 0; try < ARRAY_SIZE (pcoffs); try++) + for (attempt = 0; attempt < ARRAY_SIZE (pcoffs); attempt++) { - if (insns_match_pattern (gdbarch, sp + pcoffs[try], + if (insns_match_pattern (gdbarch, sp + pcoffs[attempt], hppa_sigtramp, dummy)) { - offs = sfoffs[try]; + offs = sfoffs[attempt]; break; } } @@ -171,8 +170,8 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) /* sigaltstack case: we have no way of knowing which offset to use in this case; default to new kernel handling. If this is wrong the unwinding will fail. */ - try = 2; - sp = pc - pcoffs[try]; + attempt = 2; + sp = pc - pcoffs[attempt]; } else { @@ -186,7 +185,7 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) bad we cannot include system specific headers :-(. sizeof(struct siginfo) == 128 offsetof(struct ucontext, uc_mcontext) == 24. */ - return sp + sfoffs[try] + 128 + 24; + return sp + sfoffs[attempt] + 128 + 24; } struct hppa_linux_sigtramp_unwind_cache @@ -205,7 +204,7 @@ hppa_linux_sigtramp_frame_unwind_cache (struct frame_info *this_frame, int i; if (*this_cache) - return *this_cache; + return (struct hppa_linux_sigtramp_unwind_cache *) *this_cache; info = FRAME_OBSTACK_ZALLOC (struct hppa_linux_sigtramp_unwind_cache); *this_cache = info; @@ -480,14 +479,10 @@ hppa_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - cb (".reg", 80 * tdep->bytes_per_address, &hppa_linux_regset, - NULL, cb_data); - cb (".reg2", 64 * 4, &hppa_linux_fpregset, NULL, cb_data); + cb (".reg", 80 * tdep->bytes_per_address, 80 * tdep->bytes_per_address, + &hppa_linux_regset, NULL, cb_data); + cb (".reg2", 64 * 4, 64 * 4, &hppa_linux_fpregset, NULL, cb_data); } - - -/* Forward declarations. */ -extern initialize_file_ftype _initialize_hppa_linux_tdep; static void hppa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -519,6 +514,7 @@ hppa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) some discussions to support 128-bit long double, but it requires some more work in gcc and glibc first. */ set_gdbarch_long_double_bit (gdbarch, 64); + set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double); set_gdbarch_iterate_over_regset_sections (gdbarch, hppa_linux_iterate_over_regset_sections);