Re: [Qemu-devel] arm return

2012-06-01 Thread Max Filippov
On Fri, Jun 1, 2012 at 5:14 PM, Davide Ferraretto wrote: > I compile so: > arm-elf-gcc-4.0.2 prog -o prog As its name suggests, arm-elf-gcc builds bare-metal ELF that wouldn't run on linux, doesn't it? And what about the other question, what does qemu-arm -strace prog print? -- Thanks. -- Max

Re: [Qemu-devel] arm return

2012-06-01 Thread Max Filippov
On Fri, Jun 1, 2012 at 5:01 PM, Davide Ferraretto wrote: > I run qemu-arm -singlestep prog > > Linux shell --> host. Ok, and you build 'prog' as a static linux ELF for ARM? What does qemu-arm -strace prog print? -- Thanks. -- Max

Re: [Qemu-devel] arm return

2012-06-01 Thread Max Filippov
On Fri, Jun 1, 2012 at 4:30 PM, Davide Ferraretto wrote: > I'm in "arm user space" with "sigle step mode". I want write "exit\n" in > linux shell (no QEMU monitor) when emulate code arrives to "return 0" Ok, what do you execute and where? Is it qemu-arm or qemu-system-arm? In the latter case do y

Re: [Qemu-devel] arm return

2012-06-01 Thread Davide Ferraretto
I'm in "arm user space" with "sigle step mode". I want write "exit\n" in linux shell (no QEMU monitor) when emulate code arrives to "return 0" On 06/01/12 14:23, Max Filippov wrote: On Fri, Jun 1, 2012 at 3:57 PM, Davide Ferraretto wrote: I tried to insert " printf("exit\n"); ", but qemu dos

Re: [Qemu-devel] arm return

2012-06-01 Thread Max Filippov
On Fri, Jun 1, 2012 at 3:57 PM, Davide Ferraretto wrote: > I tried to insert " printf("exit\n"); ", but qemu dosen't write to monitor. printf should not write to monitor (if you mean QEMU monitor), it should go to stdout. I don't have ARM compiler set up ATM, but x86_64 with the following patch d

[Qemu-devel] arm return

2012-06-01 Thread Davide Ferraretto
I tried to insert " printf("exit\n"); ", but qemu dosen't write to monitor. On 06/01/12 13:43, Max Filippov wrote: On Fri, Jun 1, 2012 at 3:16 PM, Davide Ferraretto wrote: In arm user mode, where does qemu exit? Where is last qemu's instruction? I.E. int main (){return 0;} in what file does

Re: [Qemu-devel] arm return

2012-06-01 Thread Max Filippov
On Fri, Jun 1, 2012 at 3:16 PM, Davide Ferraretto wrote: > In arm user mode, where does qemu exit? Where is last qemu's instruction? > > I.E. > int main (){return 0;} > in what file does qemu run "return 0"?? Simulated code reaches the point where libc calls 'exit' or 'exit_group' syscall and the

[Qemu-devel] arm return

2012-06-01 Thread Davide Ferraretto
In arm user mode, where does qemu exit? Where is last qemu's instruction? I.E. int main (){return 0;} in what file does qemu run "return 0"??