Still having the issue of FM/semi-hosting not catching seg-faults using 2013.06. With "aem-ve.specs", a fault seems to call main() repeatedly. With "dimon.specs", FM hangs. Any ideas how to properly compile/deal with faults in semi-hosting mode?
thanks, Rory
=== hello.c === #include <stdio.h>
int main(int argc, char *argv[]) { printf("hello.\n"); * ((unsigned int *) 0) = 0; // cause seg-fault
return 0; }
=== compile/run === .../gcc-linaro-aarch64-none-elf-4.8-2013.06_linux/bin/aarch64-none-elf-gcc -specs=aem-ve.specs -march=armv8-a -c hello.c .../gcc-linaro-aarch64-none-elf-4.8-2013.06_linux/bin/aarch64-none-elf-gcc -o hello -specs=aem-ve.specs -march=armv8-a hello.o
.../Foundation_v8 --image hello --quiet --semihost-cmd=hello
hello. hello. hello. hello. hello. ...
Hi Rory,
On 06/21/2013 05:21 PM, rorycollins@hushmail.com wrote:
Still having the issue of FM/semi-hosting not catching seg-faults using 2013.06. With "aem-ve.specs", a fault seems to call main() repeatedly. With "dimon.specs", FM hangs. Any ideas how to properly compile/deal with faults in semi-hosting mode?
I haven't had a chance to test this out, but I believe the problem may be that the exception vectors aren't page aligned.
Christopher
Christopher,
Nice call. Changing the .align let's the exception report and exit the sim properly ("Terminated by exception.") See below. Now to figure out how to redirect the exception to a signal handler or debugger so I can figure out where it came from. Can I hook up rdimon/FM to gdb w/ semi-hosting? Or perhaps use signal()?
thanks, Rory
--- libgloss/aarch64/cpu-init/rdimon-aem-el3_mod.S 2013-06-22 18:35:09.028967105 -0700 +++ libgloss/aarch64/cpu-init/rdimon-aem-el3.S 2012-09-26 13:11:54.000000000 -0700 @@ -78,7 +78,7 @@ b \label .endm
- .align 12 + .align 7
/* AArch64 Exception Model -- 3.5.5 Exception Vectors. */
On 06/21/2013 at 3:48 PM, "Christopher Covington" cov@codeaurora.org wrote:Hi Rory,
On 06/21/2013 05:21 PM, rorycollins@hushmail.com wrote:
Still having the issue of FM/semi-hosting not catching seg-faults using 2013.06. With "aem-ve.specs", a fault seems to call main() repeatedly. With "dimon.specs", FM hangs. Any ideas how to properly compile/deal with faults in semi-hosting mode?
I haven't had a chance to test this out, but I believe the problem may be that the exception vectors aren't page aligned.
Christopher
On 21 June 2013 22:21, rorycollins@hushmail.com wrote:
Still having the issue of FM/semi-hosting not catching seg-faults using 2013.06. With "aem-ve.specs", a fault seems to call main() repeatedly. With "dimon.specs", FM hangs.
Just a minor note, but the model is almost certainly not hanging. It's much more likely that your guest program has gone into an infinite loop (probably an infinite loop of taking exceptions).
thanks -- PMM
linaro-toolchain@lists.linaro.org