Download TMS320C4x C SOURCE DEBUGGER USER'S GUIDE
Transcript
Loading Object Code 6.3 Loading Object Code In order to debug a program, you must load the program’s object code into memory. You can do this as you’re invoking the debugger, or you can do it after you’ve invoked the debugger. (Note that you create an object file by compiling, assembling, and linking your source files; see Section 1.5, Preparing Your Program for Debugging, on page 1-11.) Loading code while invoking the debugger You can load an object file when you invoke the debugger (this has the same effect as using the debugger’s LOAD command). To do this, enter: Emulator: emu40 object filename Simulator: sim40 object filename If you want to load a file’s symbol table only, use the –s option (this has the same effect as using the debugger’s SLOAD command). To do this, enter: Emulator: emu40 –s object filename Simulator: sim40 –s object filename Loading code after invoking the debugger After you invoke the debugger, you can use one of three commands to load object code and/or the symbol table associated with an object file. Use these commands as described below, or use them from the Load pulldown menu. load Use the LOAD command to load both an object file and its associated symbol table. In effect, the LOAD command performs both a RELOAD and an SLOAD. The format for this command is: load object filename If you don’t supply an extension, the debugger will look for filename.out. reload Use the RELOAD command to load only an object file without loading its associated symbol table. This is useful for reloading a program when memory has been corrupted. The format for this command is: reload object filename sload Use the SLOAD command to load only a symbol table. The format for this command is: sload object filename SLOAD is useful in a debugging environment in which the debugger cannot, or need not, load the object code (for example, if the code is in ROM). SLOAD clears the existing symbol table before loading the new one but does not modify memory or set the program entry point. 6-10