From: Andreas Arnez Date: Thu, 9 Oct 2014 11:32:22 +0000 (+0000) Subject: Remove non-address bits for longjmp resume breakpoint X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8fa0c4f8ed9e520c39132bc62d51a490a17c537f;p=binutils-gdb.git Remove non-address bits for longjmp resume breakpoint On 32-bit S390 targets the longjmp target address "naturally" has the most significant bit set. That bit indicates the addressing mode and is not part of the address itself. Thus, in analogy with similar cases (like when computing the caller PC in insert_step_resume_breakpoint_at_caller), this change removes non-address bits from the longjmp target address before using it as a breakpoint address. Note that there are two ways for determining the longjmp target address: via a probe or via a gdbarch method. This change only affects the probe method, because it is assumed that the address returned by the gdbarch method is usable as-is. This change was tested together with a patch that enables longjmp probes in glibc for S/390: https://sourceware.org/ml/libc-alpha/2014-10/msg00277.html gdb/ChangeLog: * gdb/infrun.c (process_event_stop_test): Apply gdbarch_addr_bits_remove to longjmp resume address. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 977590a9f11..a43e36e0591 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-10-15 Andreas Arnez + + * gdb/infrun.c (process_event_stop_test): Apply + gdbarch_addr_bits_remove to longjmp resume address. + 2014-10-15 Pedro Alves * regformats/microblaze.dat: Delete file. diff --git a/gdb/infrun.c b/gdb/infrun.c index 55363503241..613227463a1 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4596,7 +4596,10 @@ process_event_stop_test (struct execution_control_state *ecs) is the third argument to the probe. */ arg_value = probe_safe_evaluate_at_pc (frame, 2); if (arg_value) - jmp_buf_pc = value_as_address (arg_value); + { + jmp_buf_pc = value_as_address (arg_value); + jmp_buf_pc = gdbarch_addr_bits_remove (gdbarch, jmp_buf_pc); + } else if (!gdbarch_get_longjmp_target_p (gdbarch) || !gdbarch_get_longjmp_target (gdbarch, frame, &jmp_buf_pc))