Debugger don't step inside functions other than main in project

Hello, project configured for ARM CM55, compiler optimization -Ofast, link time optimizations disabled

Here is main function



int
main() {

printf("!");

printf("hello!");

/* testAll_flatten();*/

return 0;

}



Debugger can step in main and output printf() in console but when i comment printf() and uncomment testAll_flatten module, that contains different tests, function calls etc i see next errors and warnings and cannot debug my project or just see printf() in console...


and after pressing Continue i see only


wait
continue
NORMAL_TERMINATION
Execution stopped in Secure Privileged Thread mode at 0x000010E4 due to application reaching end of execution
0x000010E4 BKPT #0xab


Here I attach additional info about debug configuration and scatter file


https://drive.google.com/file/d/16Q9u_kfOA9pnwwTqkNLxrN0y0fKmiXom/view?usp=sharing (scatter file)

Similar problems are encountered in other larger projects configured in a similar way, I suspect that there may be something wrong with my scatter file, or that some functions, files, (if I understood correctly) are not in the execution range... 

How to fix that and how to debug without these problems?

Parents
  • Hi

    My name is Stephen and I work at Arm.

    Which Arm Compiler are you using?  I assume it is Arm Compiler for Embedded 6, but let me know if not.

    As a first step, try compiling with a lower optimization level (e.g. -O1), and the printf's and testAll_flatten() both uncommented.  Also add a printf after testAll_flatten().

    Re-compile, then run.  After reaching main(), single step over the printf's  Do the printf's work ok?

    Then open the Disassembly view to see the instructions generated.  Do you see a BL call to testAll_flatten()?  If so, single-step at instruction level (press F10 to toggle between single-stepping at instruction level and source-code level) to testAll_flatten() and then into it.  If not, it may have been optimized away or otherwise removed.  Try linking with the armlink option "--info unused" to check whether the linker is removing any code/data.

    If you need more help, please show us the disassembly of main().
    I couldn't access your scatter-file, but feel free to paste it directly here if you need more help.

    Stephen

Reply
  • Hi

    My name is Stephen and I work at Arm.

    Which Arm Compiler are you using?  I assume it is Arm Compiler for Embedded 6, but let me know if not.

    As a first step, try compiling with a lower optimization level (e.g. -O1), and the printf's and testAll_flatten() both uncommented.  Also add a printf after testAll_flatten().

    Re-compile, then run.  After reaching main(), single step over the printf's  Do the printf's work ok?

    Then open the Disassembly view to see the instructions generated.  Do you see a BL call to testAll_flatten()?  If so, single-step at instruction level (press F10 to toggle between single-stepping at instruction level and source-code level) to testAll_flatten() and then into it.  If not, it may have been optimized away or otherwise removed.  Try linking with the armlink option "--info unused" to check whether the linker is removing any code/data.

    If you need more help, please show us the disassembly of main().
    I couldn't access your scatter-file, but feel free to paste it directly here if you need more help.

    Stephen

Children