Re: [arm-gnu] Simulating arm on x86
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] Simulating arm on x86



On Wednesday 15 September 2004 18:25, Patrick Bellasi wrote:
> Hi again all!
>
>  I need the value assumed by PC during the execution of a simple program
> compiled on a x86 with:
>  arm-none-elf-gcc -mcpu=arm7tdmi -mthumb -mthumb-interwork ...
>
>  Well... the problem is thath I don't have an ARM processor! There is a way
> to get those values?!?... using an istruction set simulator, may be?
> I've tried qemu... but it terminate abnormalli with:
>
> qemu: unhandled CPU exception 0x2 - aborting
> R00=00000016 R01=00008204 R02=00000000 R03=00000000
> R04=00000000 R05=00000000 R06=00000000 R07=00000000
> R08=00000000 R09=00000000 R10=00000000 R11=00000000
> R12=00000000 R13=401d7fb0 R14=00000000 R15=00008120
> PSR=00000010 ----
> qemu: uncaught target signal 6 (Aborted) - exiting
>
> just at the entry point of my program!
>
> Any idea?!? Is it possible to use GDB?!?

The arm-none-elf toolchain uses an embedded abi, whereas qemu emulated the 
arm-linux abi. These use different conventions for making system calls.

GDB does contain an arm simulator.

You have two options, both of which should work:

* Target arm-none-elf and use the GDB simulator.
* Target arm-linux and use qemu. You'll also need to find and build glibc.

Using the GDB simulator is the easiest option, as long as your application 
doesn't require a unix environment.

If you do use qemu, you may need the latest CVS version, plus other patches. 
Search the qemu-devel list for patches from myself. Also note that gdb does 
not work under qemu.

Paul