13. Working in a Cross Environment
This chapter explains how to adapt your project and configure GNAT Studio when working in a cross environment.
13.1. Customizing your Projects
This section describes some possible ways to customize your projects when working in a cross environment. For more details on the project capabilities, see Project Handling.
Several GPR project attributes are particularly relevant to cross environments: the Target and the Runtime attributes. These attributes will determine which compiler and runtime will be used to build your program.
You can read the GNAT User’s Guide Supplement for Cross Platforms for more information about development in cross environments.
13.2. Debugger Issues
This section describes debugger issues specific to cross environments. You will find more information on debugging at Debugging.
To automatically connect to the correct remote debug agent when starting a debugging session (using the menu ), be sure to specify the IDE’Program_Host and IDE’Protocol project attributes. You can also connect (or reconnect) to the remote agent at any time via the menu.
For example, if you are using the Tornado environment, with a target
server called target_ppc, set the IDE’Protocol to
wtx and the IDE’Program_Host to target_ppc.
GNAT Studio waits for a certain amount of time when trying to connect to a target: if GDB does not asnwer during this time period, GNAT Studio interupts the current debugger command and assumes that we failed to connect to the target. You can set this time period with the preference.
To load a new module on the target, select the menu.
If a module has been loaded on the target and is not known to the current debug session, use the menu to load the symbol tables in the current debugger.
For bare-metal development, all these steps can be done at once using the Flash to Board and Debug on Board toolbar buttons. These buttons allow you to build, flash and/or debug your software on the board, spawning the remote debug agent set in the IDE’Connection_Tool project attribute. GNAT Studio currently supports OpenOCD, st-util and py-ocd as connection tools. You can leave the IDE’Connection_Tool project attribute empty if you are using a connection tool that is not supported by GNAT Studio: in that case, GNAT Studio will still try to connect to the board and everything should work fine if your connection tool has been spawned correctly.