* Some problem in ARM (armemu.c)
@ 2004-12-09 11:21 libra
2004-12-09 14:24 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: libra @ 2004-12-09 11:21 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Some problem in ARM (armemu.c)
2004-12-09 11:21 Some problem in ARM (armemu.c) libra
@ 2004-12-09 14:24 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2004-12-09 14:24 UTC (permalink / raw)
To: libra; +Cc: gdb
On Thu, Dec 09, 2004 at 07:20:51PM +0800, libra wrote:
> 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.
Probably something in the startup code from newlib uses addition, and
goes into an infinite loop with your broken addition.
The simulator is part of GDB; you can load a.out into GDB and run it to
see what happens.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-12-09 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-09 11:21 Some problem in ARM (armemu.c) libra
2004-12-09 14:24 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).