DDC-I Logo

Sitemap  

DDC-I Ada Compiler System  
Using Debugger Scripts in the SCORE Multi-Language Debugger
Product Family: SCORE Target CPU: PC/Windows, SPARC/Solaris, 1750A, PowerPC, 80x86/Pentium Language: Ada, C, EmbeddedC++, Fortran Host: PC/Windows, SPARC/Solaris

Suppose that you find that there is some set of commands that you frequently perform while debugging. The SCORE Multi-Language Debugger supports several ways of saving the effort of always typing the commands or executing them from GUI menus. The primary two ways of doing this are by using debugger scripts and debugger subprograms. Debugger scripts and debugger subprograms are similar with debugger subprograms providing somewhat greater capabilities. This article will cover debugger scripts. A future article will cover debugger subprograms and their uses.

Simply put a debugger script is a text file that contains debugger commands. Any debugger command is allowed in a debugger script. You can enter these commands into a file of any name you wish, for example Common_Commands.dbg. The file may be created using a host resident text editor. Now, whenever you want to do the commands in the file, you can just enter the command

define debug input Common_Commands.dbg.

This can be done in the GUI Debugger Command Window. Since a debugger script is just the simplest form of debugger subprogram, the commands can also be run by using the pull-down menu item Debugger | Subprograms | Execute Subprogram... dialog.

As soon as the command is given, commands are taken from the file to be executed by the debugger. Of course, as with any commands, some or all of them could produce errors.

Command files may be nested to any level, even recursively. That is, a command file can contain a define debug input command. Upon reaching end of file the control passes to the calling level, or if the level was the first level, control is passed back to the user. An explicit return command can also be used. The explicit return is most useful with debugger control structures (if, loop, etc.). When the debugger is used interactively, the debugger passes control to the user or an outer command file when reaching end of file or return in a command file. The command file may be created using a host resident editor to create a text file or it may be created by logging the debugger commands to the command log file using the debugger’s logging capability.

One of the biggest uses of debugger scripts is to perform some initial sequence of commands to set up a set of initial breakpoints and tracepoints, and perhaps to run to an appropriate location. Let’s say that you put these commands into a debugger script called my_commands.startup. You would then start the debugger and execute the commands in the script by one of the methods described above. You would then be ready to continue debugging after having run your startup script.

The SCORE Multi-Language Debugger makes the above process simpler, by taking a command line parameter to specify a debugger script to be run after the program to be debugged is downloaded to the target (or in the native case, prepared for debugging). The way to specify this on the Multi-Language Debugger invocation is with the -startup_file (or for Windows /startup_file ) invocation parameter. In the GUI, this can be set on the Tool Options | Debug tab where you can either type in the startup file name, or browse for it. A startup file can contain the commands for an entire debug session including the quit command. This can be useful along with the debugger’s logging capability to capture a test run. In a future article, the use of the SCORE Multi-Language debugger for automated testing will be covered.

 

Contact
602-275-7172
sales@ddci.com

IDIQ Contract Vehicles:
--------------
AMCOM Express
DESP II
F2AST
R23G

Links

Support

Members Area
    -Member Login/Return
    -Login Help

Atlas Support Packages
    -Atlas Premium
    -Atlas Advantage
    -Atlas Choice

Complimentary Support

Submit a Software Trouble Report

Customer Quote:
"If only more vendors provided your level of service."