Some problem in ARM (armemu.c)

libra mr924352@cs.nthu.edu.tw
Thu Dec 9 11:21:00 GMT 2004


Hello,all

          I am trying to modify the arm file (gdb/sim/arm/armemu.c) to fit my
          research  purpose. In this file(armemu.c), the
          function "ARMul_Emulate32 (ARMul_State * state)" simulate the ARM
          instruction set.

          My question is that when i modify the instrction operation (see
          below 1), and rebuild the gdb, i also write a test program(see
          below 2). Once exexuting the test program(see below 3), the whole
          program halt. I do not know what happen, because i think the
          modifying is simple.


                                                        Thanks a lot!!
                                                        Best Regards!!

          1. the origin code :
             case 0x08:      /* ADD reg */
               ....
               .....
              rhs = DPRegRHS;
              dest = LHS + rhs;
              WRITEDEST (dest);
              break;

              after modifying :
               case 0x08:      /* ADD reg */
               ....
               .....
              rhs = DPRegRHS;
              dest = LHS + rhs + 1; /*add one*/
              WRITEDEST (dest);
              break;

            2. test program :
               #include <stdio.h>
               void main()
               {
                  int a=0,b=1,c=2;
                  a=b+c;
                  printf("the result is %d\n",a);
               }

             3. execution process :

                arm-elf-run a.out
                /*The program halt*/



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Computer Science Department, National Tsing Hua University



More information about the Gdb mailing list