|Non-Confidential||PDF version||ARM DUI0446Z|
|Home > Running DS-5 Debugger from the operating system command-line or from a script > Running a debug session from a script|
To automate a debug session from a script, create a text file with a .ds file extension and list, line-by-line, the debugger commands that you want to execute. Then, use the debugger command to run the script.
The script is a text file with a .ds file extension. The debugger commands are listed one after the other in the file.
Things to remember when you create a .ds script file.
A simple sample script file is shown below:
# Filename: myScript.ds # Initialization commands load file "struct_array.axf" # Load image and symbols break main # Set breakpoint at main() break *0x814C # Set breakpoint at address 0x814C # Run to breakpoint and print required values run # Start running device wait 0.5s # Wait or time-out after half a second info stack # Display call stack info registers # Display info for all registers # Continue to next breakpoint and print required values continue # Continue running device wait 0.5s # Wait or time-out after half a second info functions # Displays info for all functions info registers # Display info for all registers x/3wx 0x8000 # Display 3 words of memory from 0x8000 (hex) delete 1 # Delete breakpoint number 1 delete 2 # Delete breakpoint number 2
After creating the script, use the debugger command to run the script using the command-line interface.
On Windows, use the DS-5 Command Prompt. On Linux, set the required environment variables, and use the UNIX shell.
There are two scenarios where you might run scripts:
You have set up your target and it is connected to DS-5.
In this case, use the source command to load your script.
You are yet to configure the target and connect to it.
In this case, you have to use the appropriate debugger options and arguments to configure and connect to your target. Along with the configuration options, use the --script= filename option to run your script.
debugger --cdb-entry "ARM Development Boards::Versatile Express A9x4::Bare Metal Debug::Bare Metal SMP Debug of all cores::Debug Cortex-A9x4 SMP::DSTREAM"--cdb-entry-param "Connection=TCP:10.5.20.64" --cdb-entry-param "dtsl_options_file=C:\DS-5_Workspace\my_dtsl_settings.dtslprops" --script= C:\DS-5_Workspace\my_script.txt
See Specifying a custom configuration database using the command-line and Capturing trace data using the command-line debugger for examples of how debugger options and arguments are used.