Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ben Harris <bjh21@netbsd.org>
To: <gdb-patches@sourceware.cygnus.com>
Subject: Fix arm_addr_bits_remove: 26-bit Thumb doesn't exist
Date: Sat, 20 Oct 2001 10:23:00 -0000	[thread overview]
Message-ID: <Pine.SOL.4.33.0110201758490.17268-100000@virgo.cus.cam.ac.uk> (raw)

I haven't actually encountered this bug in reality yet, but it looks to me
as if arm_addr_bits_remove() is bogus.  Specifically, it has a case for
Thumb state in a 26-bit mode.  According to the ARM ARM (2nd Edition,
section A8.1), no processor will support both 26-bit mode and thumb state
at all, let alone at the same time.  I suspect this might be a noticable
problem when debugging SVC mode code, since then R15 will have its bottom
bit set, which arm_pc_is_thumb() is likely to interpret as meaning the CPU
is in Thumb state.

ChangeLog entry:

2001-10-20  Ben Harris  <bjh21@netbsd.org>

	* arm-tdep.c (arm_addr_bits_remove): Don't believe in 26-bit
	Thumb.

Patch:
*** arm-tdep.c	2000/07/26 00:32:33
--- arm-tdep.c	2001/10/20 17:14:36
*************** arm_pc_is_thumb_dummy (bfd_vma memaddr)
*** 270,279 ****
  CORE_ADDR
  arm_addr_bits_remove (CORE_ADDR val)
  {
!   if (arm_pc_is_thumb (val))
!     return (val & (arm_apcs_32 ? 0xfffffffe : 0x03fffffe));
    else
!     return (val & (arm_apcs_32 ? 0xfffffffc : 0x03fffffc));
  }

  CORE_ADDR
--- 270,281 ----
  CORE_ADDR
  arm_addr_bits_remove (CORE_ADDR val)
  {
!   if (!arm_apcs_32)
!     return (val & 0x03fffffc);
!   else if (arm_pc_is_thumb (val))
!     return (val & 0xfffffffe);
    else
!     return (val & 0xfffffffc);
  }


-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL: http://www.netbsd.org/Ports/arm26/ >


             reply	other threads:[~2001-10-20 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-20 10:23 Ben Harris [this message]
2001-10-20 10:46 ` Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.SOL.4.33.0110201758490.17268-100000@virgo.cus.cam.ac.uk \
    --to=bjh21@netbsd.org \
    --cc=gdb-patches@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox