bochs用户手册-8内部调试器

原文链接:https://bochs.sourceforge.io/cgi-bin/topper.pl?name=New+Bochs+Documentation&url=https://bochs.sourceforge.io/doc/docbook/user/index.html

Chapter 8. The Bochs internal debugger (Bochs内部调试器)

8.1. Using the command line debugger 使用命令行调试器

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: 从这里,您可以使用以下命令:

8.1.1. Execution Control 执行控制

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

8.1.2. BreakPoints 断点

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

8.1.3. Memory WatchPoints 内存监视点

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 开/关启用/禁用内存访问跟踪

先到这里,有时间再继续。。。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
C语言是一种广泛使用的编程语言,它具有高效、灵活、可移植性强等特点,被广泛应用于操作系统、嵌入式系统、数据库、编译器等领域的开发。C语言的基本语法包括变量、数据类型、运算符、控制结构(如if语句、循环语句等)、函数、指针等。在编写C程序时,需要注意变量的声明和定义、指针的使用、内存的分配与释放等问题。C语言中常用的数据结构包括: 1. 数组:一种存储同类型数据的结构,可以进行索引访问和修改。 2. 链表:一种存储不同类型数据的结构,每个节点包含数据和指向下一个节点的指针。 3. 栈:一种后进先出(LIFO)的数据结构,可以通过压入(push)和弹出(pop)操作进行数据的存储和取出。 4. 队列:一种先进先出(FIFO)的数据结构,可以通过入队(enqueue)和出队(dequeue)操作进行数据的存储和取出。 5. 树:一种存储具有父子关系的数据结构,可以通过中序遍历、前序遍历和后序遍历等方式进行数据的访问和修改。 6. 图:一种存储具有节点和边关系的数据结构,可以通过广度优先搜索、深度优先搜索等方式进行数据的访问和修改。 这些数据结构在C语言中都有相应的实现方式,可以应用于各种不同的场景。C语言中的各种数据结构都有其优缺点,下面列举一些常见的数据结构的优缺点: 数组: 优点:访问和修改元素的速度非常快,适用于需要频繁读取和修改数据的场合。 缺点:数组的长度是固定的,不适合存储大小不固定的动态数据,另外数组在内存中是连续分配的,当数组较大时可能会导致内存碎片化。 链表: 优点:可以方便地插入和删除元素,适用于需要频繁插入和删除数据的场合。 缺点:访问和修改元素的速度相对较慢,因为需要遍历链表找到指定的节点。 栈: 优点:后进先出(LIFO)的特性使得栈在处理递归和括号匹配等问题时非常方便。 缺点:栈的空间有限,当数据量较大时可能会导致栈溢出。 队列: 优点:先进先出(FIFO)的特性使得

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值