NOEL-ARTYA7-EX-QSG
December 2020, Version 1.2
14
www.cobhamaes.com/gaisler
command line switch, so that target application console output (APBUART) is shown directly in the GRMON
console.
Example 5.1.
$ grmon -digilent -u
GRMON debug monitor v3.2.9 64-bit version
grmon3> dtb board.dtb
DTB will be loaded to the stack
grmon3> load hello.exe
00000000 .start 76B [===============>] 100%
0000004C .text 98.6kB / 98.6kB [===============>] 100%
00018AB0 .rodata 83.5kB / 83.5kB [===============>] 100%
0002D8E0 .sdata2 48B [===============>] 100%
0002D910 .eh_frame 4B [===============>] 100%
0002D918 .init_array 8B [===============>] 100%
0002D920 .fini_array 8B [===============>] 100%
0002D928 .rtemsroset 112B [===============>] 100%
0002D998 .data 2.3kB / 2.3kB [===============>] 100%
0002E2C0 .htif 4.0kB / 4.0kB [===============>] 100%
00030000 .sdata 208B [===============>] 100%
Total size: 188.86kB (1.12Mbit/s)
Entry point 0x00000000
Image hello.exe loaded
grmon3> run
hello, world
CPU 0: Forced into debug mode
0x0001607c: 00100073 ebreak <_CPU_Fat36>
CPU 1: Interrupted!
0x00011018: 10500073 wfi <_CPU_Thread_Id0>
grmon3>
To debug the compiled program you can insert break points, step and continue directly from the GRMON console.
Compilation symbols are loaded automatically by GRMON once you load the executable. An example is provided
below.
grmon3> load hello.exe
[...]
Total size: 188.86kB (1.12Mbit/s)
Entry point 0x00000000
Image hello.exe loaded
grmon3> bp Init
Software breakpoint 1 at <Init>
grmon3> run
Breakpoint 1 hit
0x00000118: 1141 addi sp, sp, -16 <Init+0>
grmon3> inst 5
TIME L P ADDRESS INSTRUCTION RESULT SYMBOL
593654 1 M 0000705a jalr ra, a5 [000000000000705C] _Thread_0x4e
593658 1 M 00007684 ld t1, 272(a0) [0000000000000118] _Thread_Entry_adaptor_0x0
593660 0 M 00007688 ld a0, 280(a0) [0000000000023128] _Thread_Entry_adaptor_0x4
593660 1 M 0000768c jalr zero, t1 [000000000000768E] _Thread_Entry_adaptor_0x8
593695 0 M 00000118 addi sp, sp, -16 [ BREAKPOINT ] Init+0x0
grmon3> step
0x4000013c: 4002e537 lui a0, 0x4002e <Init+0>
grmon3> inst 5
TIME L P ADDRESS INSTRUCTION RESULT SYMBOL
593660 0 M 00007688 ld a0, 280(a0) [0000000000023128] _Thread_Entry_adaptor_0x4
593660 1 M 0000768c jalr zero, t1 [000000000000768E] _Thread_Entry_adaptor_0x8
593695 0 M 00000118 ebreak [ BREAKPOINT ] Init+0x0
593728 0 M 00000118 addi sp, sp, -16 [0000000000029D70] Init+0x0
593729 0 M 0000011a sd s0, 0(sp) [0000000000029D70] Init+0x2