-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmem
More file actions
28 lines (27 loc) · 660 Bytes
/
Copy pathxmem
File metadata and controls
28 lines (27 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
define xmem
dont-repeat
set $memaddr = (int *)(&mem)
set $addr = $memaddr + (int)e
set $endaddr = $memaddr + (int)g
if $endaddr < $addr
set $endaddr = $memaddr + (int)m
end
while $addr < $endaddr
printf "%d: ", $addr - $memaddr
set $lineendaddr = $addr + 5
if $lineendaddr > $endaddr
set $lineendaddr = $endaddr
end
set $a = $addr
while $a < $lineendaddr
printf "%4d ", *(unsigned int *)$a
set $a++
end
printf "\n"
set $addr = $addr + 5
end
end
document xmem
usage: xmem
outputs syntax memory layout, 5 per row
end