树莓派编程:调试、内存访问与ARM汇编指令详解
1. 调试会话示例
以下是一个调试会话的示例,展示了如何单步执行程序并显示寄存器内容:
Breakpoint 1 at 0x10074: file t1a.s, line 7.
(gdb) r 1
Starting program: /home/pi/Desktop/t1a 1
Breakpoint 1, _start () at t1a.s:7
7 _start: mov r0,#23 @ Just three dummy operations for debugging
(gdb) si 1
8 mov r1,#v1
9 add r2,r0,r1
11 ldr r1,=banner @ Test display function (r1 has address of a string)
12 mov r2,#15 @ Number of characters to print 13 plus two newlines)
13 mov r0,#1 @ Tell the OS we want to print on console display
14 mov r7,#4 @ Tell the OS we want to perform a print operation
15 svc 0 @ Call the operating system to do the printing
Test printing
17 adr
超级会员免费看
订阅专栏 解锁全文
112

被折叠的 条评论
为什么被折叠?



