diff mbox

gdbarch: fix default value of significant_addr_bit

Message ID 20180417130218.23766-1-vlad.ivanov@lab-systems.ru
State New
Headers show

Commit Message

vlad.ivanov@lab-systems.ru April 17, 2018, 1:02 p.m. UTC
MIPS targets use signed PC values.  Since commit a0de8c21
single-stepping on these targets didn't work due to the addition of
`address_significant` in adjust_breakpoint_address.  This commit
sets significant_addr_bit in gdbarch to number of bits in bfd_vma,
as suggested by Maciej W. Rozycki.

Signed-off-by: Vlad Ivanov <vlad.ivanov@lab-systems.ru>
---
 gdb/gdbarch.c  | 2 +-
 gdb/gdbarch.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 1359c2fb53..bd8e8c8966 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -622,7 +622,7 @@  verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
   /* Skip verify of addr_bits_remove, invalid_p == 0 */
   if (gdbarch->significant_addr_bit == 0)
-    gdbarch->significant_addr_bit = gdbarch_addr_bit (gdbarch);
+    gdbarch->significant_addr_bit = TARGET_CHAR_BIT * sizeof (bfd_vma);
   /* Skip verify of software_single_step, has predicate.  */
   /* Skip verify of single_step_through_delay, has predicate.  */
   /* Skip verify of print_insn, invalid_p == 0 */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 4fc54cba9c..2a37055797 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -625,7 +625,7 @@  m;CORE_ADDR;addr_bits_remove;CORE_ADDR addr;addr;;core_addr_identity;;0
 # For example, on AArch64, the top bits of an address known as the "tag"
 # are ignored by the kernel, the hardware, etc. and can be regarded as
 # additional data associated with the address.
-v;int;significant_addr_bit;;;;;gdbarch_addr_bit (gdbarch);
+v;int;significant_addr_bit;;;;;TARGET_CHAR_BIT * sizeof (bfd_vma)
 
 # FIXME/cagney/2001-01-18: This should be split in two.  A target method that
 # indicates if the target needs software single step.  An ISA method to