GRMON3-UM
June 2019, Version 3.1.0
17 www.cobham.com/gaisler
The backtrace is presented with the caller's program counter (%PC) to return to (below where the CALL instruction
was issued) and the stack pointer (%SP) at that time. The first entry (frame #0) indicates the current location of
the CPU and the current stack pointer. The right most column print out the %PC address relative the function
symbol, i.e. if symbols are present.
grmon3> bt
%pc %sp
#0 0x40003e24 0x407ffdb8 <Fft+0x4>
#1 0x40005034 0x407ffe28 <main+0xfc4>
#2 0x40001064 0x407fff70 <_start+0x64>
#3 0x4000cf40 0x407fffb0 <_hardreset_real+0x78>
NOTE: In order to display a correct backtrace for optimized code where optimized leaf functions are present a
symbol table must exist.
In a MP system the backtrace of a specific CPU can be printed, either by changing the active CPU with the cpu
command or by passing the CPU index to bt.
3.4.7. Displaying memory contents
Any memory location can be displayed and written using the commands listed in the table below. Memory com-
mands that are prefixed with a v access the virtual address space seen by doing MMU address lookups for active
CPU.
Table 3.2. Memory access commands
Command
Name
Description
mem AMBA bus 32-bit memory read access, list a range of addresses
wmem AMBA bus 32-bit memory write access
vmem AMBA bus 32-bit virtual memory read access, list a range of addresses
memb AMBA bus 8-bit memory read access, list a range of addresses
memh AMBA bus 16-bit memory read access, list a range of addresses
vmemb AMBA bus 8-bit virtual memory read access, list a range of addresses
vmemh AMBA bus 16-bit virtual memory read access, list a range of addresses
vwmemb AMBA bus 8-bit virtual memory write access
vwmemh AMBA bus 16-bit virtual memory write access
vwmems Write a string to an AMBA bus virtual memory address
vwmem AMBA bus 32-bit virtual memory write access
wmemb AMBA bus 8-bit memory write access
wmemh AMBA bus 16-bit memory write access
wmems Write a string to an AMBA bus memory address
amem AMBA bus 32-bit asynchronous memory read access
NOTE: Most debug links only support 32-bit accesses, only JTAG links support unaligned access. An unaligned
access is when the address or number of bytes are not evenly divided by four. When an unaligned data read request
is issued, then GRMON will read some extra bytes to align the data, but only return the requested data. If a write
request is issued, then an aligned read-modify-write sequence will occur.
The mem command requires an address and an optional length, if the length is left out 64 bytes are displayed. If a
program has been loaded, text symbols can be used instead of a numeric address. The memory content is displayed
in hexadecimal-decimal format, grouped in 32-bit words. The ASCII equivalent is printed at the end of the line.
grmon> mem 0x40000000
40000000 a0100000 29100004 81c52000 01000000 ...)..... .....