Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fred Fish <fnf@fred.ninemoons.com>
To: gdb-patches@sources.redhat.com
Cc: fnf@redhat.com
Subject: RFC: ARM simulator coredump
Date: Wed, 09 Jan 2002 15:00:00 -0000	[thread overview]
Message-ID: <200201092258.g09MwlU26601@fred.ninemoons.com> (raw)

The ARM simulator is dumping core during gdb testing for arm-elf:

  Program received signal SIGSEGV, Segmentation fault.
  0x08147074 in XScale_cp14_read_reg (state=0x8299ff0, reg=0, value=0x0) at /src/sourceware/gdb/src/sim/arm/armcopro.c:981
  981       * value = read_cp14_reg (reg);

This patch seems to work, but I've not really checked it too carefully
for correctness.  Can whomever is responsible for the ARM simulator
look it over please?  Thanks.

-Fred

Index: armemu.c
===================================================================
RCS file: /cvs/src/src/sim/arm/armemu.c,v
retrieving revision 1.25
diff -u -p -r1.25 armemu.c
--- armemu.c	2001/10/18 12:20:47	1.25
+++ armemu.c	2002/01/09 22:59:41
@@ -544,15 +544,16 @@ ARMul_Emulate26 (ARMul_State * state)
       /* Handle the Clock counter here.  */
       if (state->is_XScale)
 	{
-	  ARMword cp14r0 = state->CPRead[14] (state, 0, 0);
+	  ARMword cp14r0;
+	  int ok = state->CPRead[14] (state, 0, &cp14r0);
 
-	  if (cp14r0 && ARMul_CP14_R0_ENABLE)
+	  if (ok && ARMul_CP14_R0_ENABLE)
 	    {
 	      unsigned long newcycles, nowtime = ARMul_Time(state);
 
 	      newcycles = nowtime - state->LastTime;
 	      state->LastTime = nowtime;
-	      if (cp14r0 && ARMul_CP14_R0_CCD)
+	      if (ok && ARMul_CP14_R0_CCD)
 	        {
 		  if (state->CP14R0_CCD == -1)
 		    state->CP14R0_CCD = newcycles;
@@ -576,7 +577,7 @@ check_PMUintr:
 		  cp14r0 |= ARMul_CP14_R0_FLAG2;
 		  (void) state->CPWrite[14] (state, 0, cp14r0);
 
-		  cp14r1 = state->CPRead[14] (state, 1, 0);
+		  ok = state->CPRead[14] (state, 1, &cp14r1);
 
 		  /* Coded like this for portability.  */
 		  while (newcycles)
@@ -593,7 +594,8 @@ check_PMUintr:
 		  (void) state->CPWrite[14] (state, 1, cp14r1);
 		  if (do_int && (cp14r0 & ARMul_CP14_R0_INTEN2))
 		    {
-		      if (state->CPRead[13] (state, 8, 0)
+		      ARMword temp;
+		      if (state->CPRead[13] (state, 8, &temp)
 			&& ARMul_CP13_R8_PMUS)
 		        ARMul_Abort (state, ARMul_FIQV);
 		      else
Index: arminit.c
===================================================================
RCS file: /cvs/src/src/sim/arm/arminit.c,v
retrieving revision 1.7
diff -u -p -r1.7 arminit.c
--- arminit.c	2001/04/18 16:39:37	1.7
+++ arminit.c	2002/01/09 22:59:41
@@ -302,14 +302,20 @@ ARMul_Abort (ARMul_State * state, ARMwor
       SETABORT (IBIT, SVC26MODE, isize);
       break;
     case ARMul_IRQV:		/* IRQ */
-      if (!state->is_XScale
-	  || (state->CPRead[13](state, 0, 0) & ARMul_CP13_R0_IRQ))
-        SETABORT (IBIT, state->prog32Sig ? IRQ32MODE : IRQ26MODE, esize);
+      {
+	ARMword temp;
+	(void) state->CPRead[13](state, 0, &temp);
+	if (!state->is_XScale || (temp & ARMul_CP13_R0_IRQ))
+	  SETABORT (IBIT, state->prog32Sig ? IRQ32MODE : IRQ26MODE, esize);
+      }
       break;
     case ARMul_FIQV:		/* FIQ */
-      if (!state->is_XScale
-	  || (state->CPRead[13](state, 0, 0) & ARMul_CP13_R0_FIQ))
-        SETABORT (INTBITS, state->prog32Sig ? FIQ32MODE : FIQ26MODE, esize);
+      {
+	ARMword temp;
+	(void) state->CPRead[13](state, 0, &temp);
+	if (!state->is_XScale || (temp & ARMul_CP13_R0_FIQ))
+	  SETABORT (INTBITS, state->prog32Sig ? FIQ32MODE : FIQ26MODE, esize);
+      }
       break;
     }
   if (ARMul_MODE32BIT)


             reply	other threads:[~2002-01-09 23:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-09 15:00 Fred Fish [this message]
2002-01-09 15:31 ` Andrew Cagney
2002-01-10  3:28   ` Nick Clifton
2002-01-10  7:15     ` Andrew Cagney
2002-01-10  8:13       ` Nick Clifton
2002-01-10  3:29   ` ARM simulator maintainer Nick Clifton
2002-01-10  7:19     ` Andrew Cagney
2002-01-10  8:11       ` Nick Clifton
2002-01-10  8:31       ` Frank Ch. Eigler
2002-01-10 16:29         ` Andrew Cagney
2002-01-10 17:22           ` Frank Ch. Eigler
2002-01-10 17:34             ` Andrew Cagney
2002-01-10 17:53               ` Frank Ch. Eigler
2002-01-10 18:08                 ` Andrew Cagney
2002-01-11 10:31                   ` Frank Ch. Eigler
2002-01-11 11:06                     ` Andrew Cagney
2002-01-10  7:33 ` RFC: ARM simulator coredump 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=200201092258.g09MwlU26601@fred.ninemoons.com \
    --to=fnf@fred.ninemoons.com \
    --cc=fnf@redhat.com \
    --cc=gdb-patches@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