原文链接:https://bochs.sourceforge.io/cgi-bin/topper.pl?name=New+Bochs+Documentation&url=https://bochs.sourceforge.io/doc/docbook/user/index.html
You can now conditionally compile in a GDB like command line debugger, that allows you to set breakpoints, step through instructions, and other useful functions. If there isn’t a command for something you believe is generally useful for the debugger, let me know and I’ll implement it if possible.
\qquad 现在,您可以在类似GDB的命令行调试器中进行有条件编译,该调试器允许您设置断点、逐步执行指令和其他有用的函数。如果没有一个您认为对调试器通常有用的命令,请告诉我,如果可能的话,我会实现它。
Note:
This section describes how to enable and use the Bochs command line debugger. For it’s builtin graphical front-end please see the debugger gui section how to enable it. 注意:本节介绍如何启用和使用Bochs命令行调试器。对于它的内置图形前端,请参阅调试器gui部分如何启用它。
To use the debugger, you must configure Bochs with the --enable-debugger flag. For example:若要使用调试器,必须使用–enable-debugger 标志配置Bochs。例如:
./configure --enable-debugger
Note: You must use flex version 2.5.4 or greater. I have heard that version 2.5.2 will not work. 您必须使用flex 2.5.4或更高版本。我听说2.5.2版本不起作用。
When you first start up Bochs, you will see the command line prompt
当您第一次启动Bochs时,您将看到命令行提示
bochs:1>
From here, you may use the following commands: 从这里,您可以使用以下命令:
c continue executing 继续执行
cont
continue
s [count] execute count instructions, default is 1 执行计数指令,默认值为1
step [count]
s [cpu] [count] for SMP simulation, execute count instructions on cpu, default is 1 对于SMP模拟,在cpu上执行count指令,默认值为1
step [cpu] [count]
s all [count] for SMP simulation, execute count instructions on all cpus 用于SMP模拟,在所有cpu上执行count指令
step all [count]
Ctrl-C stop execution, and return to command line prompt 停止执行,返回命令行提示
Ctrl-D if at empty line on command line, exit 如果在命令行的空行,则退出
q quit debugger and execution 退出调试器和执行
quit
exit
NOTE: The format of ‘seg’, ‘off’, and ‘addr’ in these descriptions,are as follows. I don’t have any way to set the current radix. 这些描述中“seg”、“off”和“addr”的格式,如下所示。我没有办法设置当前基数。
hexidecimal: 0xcdef0123
decimal: 123456789
octal: 01234567
vbreak seg:off Set a virtual address instruction breakpoint 设置虚拟地址指令断点
vb seg:off
vbreak seg:off if “expr” Set a conditional virtual address instruction breakpoint 设置条件虚拟地址指令断点
vb seg:off if “expr”
lbreak addr Set a linear address instruction breakpoint 设置线性地址指令断点
lb addr
lbreak addr if “expr” Set a conditional linear address instruction breakpoint 设置条件线性地址指令断点
lb addr if “expr”
pbreak [] addr Set a physical address instruction breakpoint 设置物理地址指令断点
pb [] addr (the '’ is optional for GDB compatibility) 对于GDB兼容性,''是可选的)
break [] addr
b [] addr
pbreak [] addr if “expr” Set a conditional physical address instruction breakpoint 设置条件物理地址指令断点
pb [] addr if “expr” (the '’ is optional for GDB compatibility)(''是GDB兼容性的可选项)
break [] addr if “expr”
b [] addr if “expr”
info break Display state of all current breakpoints 显示所有当前断点的状态
bpe n Enable a breakpoint 启用断点
bpd n Disable a breakpoint 禁用断点
delete n Delete a breakpoint 删除断点
del n
d n
watch read addr Insert a read watch point at physical address addr 在物理地址addr插入一个读取监视点
watch r addr Insert a read watch point at physical address addr 在物理地址addr插入一个读取监视点
watch write addr Insert a write watch point at physical address addr 在物理地址addr插入一个写监视点
watch w addr Insert a write watch point at physical address addr 在物理地址addr插入一个写监视点
watch Display state of current memory watchpoints 显示当前内存监视点的状态
watch stop Stop simulation when a watchpoint is encountered (default) 遇到观察点时停止模拟(默认)
watch continue Do not stop simulation when a watchpoint is encountered 遇到观察点时不要停止模拟
unwatch addr Remove watchpoint to specific physical address 将监视点删除到特定的物理地址
unwatch Remove all watch points 移除所有观察点
trace-mem on/off Enable/Disable memory access tracing 开/关启用/禁用内存访问跟踪
先到这里,有时间再继续。。。。。。