This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Stepping in Arm swi call


The patch below adds support for stepping in swi calls. I tested it on
an Arm E7T board (I've not tested it against Thumb execution mode
though...).

Pierre
-- 
________________________________________________________________________
Pierre HABRAKEN - mailto:Pierre.Habraken@imag.fr
Tél: 04 76 82 72 83 - Fax: 04 76 82 72 87
IMAG-LSR BP72 38402 SAINT MARTIN D'HERES Cedex
________________________________________________________________________
--- hal/arm/arch/current/src/arm_stub.c.inst	Tue Nov 12 22:50:38 2002
+++ hal/arm/arch/current/src/arm_stub.c	Tue May  6 10:14:44 2003
@@ -528,7 +528,12 @@
             }
         }
     case 0x3:  // Coprocessor & SWI
-        return (pc+1);
+        if (((ins & 0x03000000) == 0x03000000) && ins_will_execute(ins)) {
+           // SWI
+           return (CYGNUM_HAL_VECTOR_SOFTWARE_INTERRUPT * 4);
+        } else {
+           return (pc+1);
+        }
     default:
         // Never reached - but fixes compiler warning.
         return 0;
@@ -570,10 +575,15 @@
         }
         break;
     case 0xd:
-        // Bcc
+        // Bcc | SWI
         // Use ARM function to check condition
         arm_ins = ((unsigned long)(ins & 0x0f00)) << 20;
-        if (ins_will_execute(arm_ins)) {
+        if ((arm_ins & 0xF0000000) == 0xF0000000) {
+            // SWI
+            new_pc =
+              MAKE_THUMB_ADDR(CYGNUM_HAL_VECTOR_SOFTWARE_INTERRUPT * 4);
+        }
+        else if (ins_will_execute(arm_ins)) {
             offset = (ins & 0x00FF) << 1;
             if (ins & 0x0080) offset |= 0xFFFFFE00;  // sign extend
             new_pc = MAKE_THUMB_ADDR((unsigned long)(pc+4) + offset);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]