User`s manual
iv Suite56 DSP Tools User’s Manual Motorola
Chapter 3
Debugging C and Assembly Code
3.1 Initializing a Debugging Environment ................................ 3-1
3.1.1 Choosing Preferences........................................... 3-1
3.1.2 DefiningPathsandWorkingDirectories............................ 3-2
3.1.3 Logging Commands for Later Reuse . . . ............................ 3-2
3.1.4 Logging a Session for Later Review . . . ............................ 3-3
3.1.5 Setting the Radix .............................................. 3-4
3.1.6 DisplayingRegisters ........................................... 3-4
3.1.7 DisplayingMemory............................................ 3-5
3.2 Source-Level Debugging in C ....................................... 3-5
3.2.1 Compiling to Debug............................................ 3-6
3.2.2 About Software Breakpoints in a C Program......................... 3-8
3.2.3 Setting Software Breakpoints in a C Program ........................ 3-9
3.2.4 To Clear a Software Breakpoint.................................. 3-11
3.2.5 About Hardware Breakpoints.................................... 3-12
3.2.6 To Set a Hardware Breakpoint................................... 3-13
3.2.7 To Clear a Hardware Breakpoint ................................. 3-15
3.2.8 DefiningaWatchListforaCProgram............................ 3-15
3.2.9 EvaluatingCExpressions ...................................... 3-16
3.2.10 CastinginaCProgram ........................................ 3-17
3.2.11 TracinginaCProgram ........................................ 3-17
3.2.12 UsingC-SpecificCommands.................................... 3-17
3.2.13 Profiling a C Program ......................................... 3-18
3.3 Symbolic Debugging in Assembly Code. . . ........................... 3-19
3.3.1 Setting Breakpoints in Assembly Code . ........................... 3-22
3.3.2 TracingAssemblyCode........................................ 3-23
3.4 Calling Assembly Code from C Code ................................ 3-24
3.5 Exploiting Memory Control Files ................................... 3-25