Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jens-Christian Lache <lache@ngi.de>
To: gdb@sources.redhat.com
Subject: a small bug in the arm simulator
Date: Sun, 25 Feb 2001 08:54:00 -0000	[thread overview]
Message-ID: <01022517503400.18397@LosBastardos> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]

Hi! 

First of all: Thank you a lot for having fixed the "swi" instruction! No
more "unknown swi xxx". I have stepped through all the code from my
swi_wrapper and swi_handler and it worked very nice! :-) :-)

I think, I have found the little bug in the arm simulator.

It is only one line in "armsupp.c", function ARMul_FicCPSR:

void
ARMul_FixCPSR (ARMul_State * state, ARMword instr, ARMword rhs)
{
  state->Cpsr = ARMul_GetCPSR (state);
  /* original src */
  /* if (state->Bank != USERBANK) */                             // buggy
  /* end original src */
  /* altered src */
    if (state->Mode != USER32MODE)
  /* end altered src */
    {				/* In user mode, only write flags */
      if (BIT (16))
	SETPSR_C (state->Cpsr, rhs);
      if (BIT (17))
	SETPSR_X (state->Cpsr, rhs);
      if (BIT (18))
	SETPSR_S (state->Cpsr, rhs);
    }
  if (BIT (19))
    SETPSR_F (state->Cpsr, rhs);
  ARMul_CPSRAltered (state);
}

The original version tried to determine the cpu state by the banked 
registers. This works most time, but not if we are in system mode. System and 
user mode have same banked registers. That why 

msr cpsr, r0

worked for all modes but not for system mode.

I don´t know, how to care about the case we are in USER26MODE, it could be 
done with some "defines" I would suppose.

I hope this little fix does not have any side effects!

Regards,

Jens-Christian

-- 
Jens-Christian Lache
www.tu-harburg.de/~sejl1601
lache@tu-harburg.de
Tel.: 01759610756 (Hamburg)


             reply	other threads:[~2001-02-25  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-25  8:54 Jens-Christian Lache [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-05-08  1:31 Nick Clifton
2001-02-23  7:50 Jens-Christian Lache

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=01022517503400.18397@LosBastardos \
    --to=lache@ngi.de \
    --cc=gdb@sources.redhat.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