Let's build our own On Chip Debugger application - STEP 2

We have now a tool capable of:
  • Control core:            run, stop, step
  • Reset (and Halt):        rst, rsthlt
  • Dump memory:             dump
  • ASCII viewer:            ascii
  • Seek in in memory:       seek
  • Read 32 bit word:        read
  • Read 8 bit word:         r8
  • Write 32 bit word:       write
  • Write 8 bit word:        w8
  • Set IP breakpoint:       bpt
  • Clear IP breakpoint:     bpt
  • Access HW frequency:     frequ
  • Exit:                    exit 
Let's add now a viewer for the TriCore CPU registers, such as:

Therefore we add a new command, in reference to the old and famous MS DOS Debug:
Core registers:       r
where implementation is quite simple and straightforward (beside the need to align the various register prints). See GitHub for the implementation details.

Such feature results into:

BY repeating the 'r' command you will experience the step by step debugging and being able to observe what happen in the CPU registers of the selected CPU (e.g. CPU0).

As for example, try the following command sequence:
  1. rsthlt > to reset and halt the CPU
  2. r        > to view the CPU registers (in my case it shows that program counter points to 0xA0000020, exactly the start address of our code located in Flash memory)
  3. step  >to execute the first instruction as defined at 0xA0000020
  4. r       > to view the CPU registers after last instruction execution
  5. ... and so on
Such results into:

For the moment, have fun with it or help me to improve it by contributing into the GitHub project.

Commenti