This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Source code level debugging on Fast Models

Note: This was originally posted on 27th November 2012 at http://forums.arm.com

I'd like to know how I can enable source code debugging with the Fast Model simulator. It allows me to load source code directories, but I don't seem to be able to load any source code files. Does it only enable debugging of actual component code, or can I not also debug what I run *on* the model itself, e.g. application/OS kernel code? Any pointers would be really appreciated.
  • Note: This was originally posted on 27th November 2012 at http://forums.arm.com

    Thanks for your reply! I run Linux (Ubuntu) so I guess it is supported ;-)
    I can launch the model debugger when running sgcanvas. So that part works. I can inspect memory and different components. However, I want to do down to instruction level debugging, e.g. I want to be able to see the ARM instructions that are executed on the CPU (eg assembly code). When I try to add source files, e.g. .asm or .S files, then they do not show on the window for adding source files.
  • Note: This was originally posted on 28th November 2012 at http://forums.arm.com

    Ahh, ok - I think I understand what you're doing.

    To do source level debug of the code running on the ARM processor you will need debug data.  This is data that the build tools generate so that a debugger can map the source level statements to the generated assembly code.  Debug data is held within the objects (.o), and later the linked image (.elf/.axf).

    First check that you are compiling your code with debug data.  If you're using armcc/armasm this means passing "--debug" or "-g".  For GCC I think it's "-g". 

    Next, how are you loading the code/data into the simulation?  Raw binary or image (.axf/.elf)?

    If it's a raw binary you'll need to separately load the debug data.  To do this go to File --> Load Application (Debug Info Only) and select the image being used.
  • Note: This was originally posted on 27th November 2012 at http://forums.arm.com

    You can debug the ARM code running in the simulation (via CADI - using RVD, DS-5, Model Debugger, etc...), or the model code itself (using Visual Studio or GDB).  Which do you want do?

    Debugging both at once can cause problems, as the ARM debugger's connection to the model may time out while you debugging the model itself.

    In terms of the debugging the model source, there is a button in the Fast Model tools GUI that should launch it for you (assuming you're using a support platform).