This is a very brief introduction into compiling ARM binaries and basic debugging with GDB. As you follow the tutorials, you might want to follow along and experiment with ARM assembly on your own. In that case, you would either need a spare ARM device, or you just set up your own Lab environment in a VM by following the steps in this short How-To.
You can use the following code from Part 7 – Stack and Functions, to get familiar with basic debugging with GDB.
可以用第七部分:栈和函数里的代码,熟悉GDB的基本调试
Personally, I prefer using GEF as a GDB extension. It gives me a better overview and useful features. You can try it out here: GEF – GDB Enhanced Features.
disable/enable <breakpoint-number-or-range> (does not delete breakpoints, just enables/disables them)
continue (or just c) – (continue executing until next breakpoint)
continue <number> (continue but ignore current breakpoint number times. Useful for breakpoints within a loop.)
finish (continue to end of function)
断点命令:
1. break(或只是b) + 函数名
2. break 行号
3. break 文件名:函数名
4. breake 文件名:行号
5. break *地址
6. break +偏移
7. break –偏移
8. tbreak(设置临时断点)
9. del 号码(删除断点号码)
10. delete (删除所有的断点)
11. delete 地址范围 (删除范围内的断点)
12. disable/enable 断点号码或者范围 (不删除断点,只是使能/去使能这些断点)
13. continue(或只是c) (继续执行直到下一个断点)
14. finish (继续执行直到末尾)
This deletes the first breakpoint and sets a breakpoint at the specified memory address. When you run the program, it will break at this exact location. If you would not delete the first breakpoint and just set a new one and run, it would break at the first breakpoint.