我是自学的mit6.s081,一个gdb的问题困扰了我几天,以至于我的lab1还没有完成。以下是对我的问题的描述:
我在两个窗口中make qemu
和gdb-multiarch
,gdb窗口中的file user/_primes
(这是lab1的primes程序,这个程序已经通过了等级,应该是正确的),然后是b main
,然后是continue
,但是后来当我是n
的时候,0x0000000000000c10 in ?? ()=> 0x0000000000000c10: 1d 71 addi sp,sp,-96
首先出现了。
又是n
“cannot find bounds of current function”
后来出现了。
我试着调试其他程序,比如pingpong
。几个步骤之后,cannot find bounds
就像质数一样,但有时n
会进入user/ulib.c
。当我调试我写的find
程序时,b main
和continue
,终端没有直接响应,我非常困惑到底是怎么回事。你有什么解决方案吗?
补充说明:我实际上是在ubuntu 20.04
虚拟机上做实验的。gcc version: 9.3.0
gdb version: 9.2
.gitinit:
set architecture riscv:rv64
target remote 127.0.0.1:26000
symbol-file kernel/kernel
set disassemble-next-line auto
set riscv use-compressed-breakpoints yes
如果您有任何建议,请提前输入here.Thanks。
发布于 2021-10-09 16:02:12
“cannot find bounds of current function”
此错误表示:
next
命令)Single stepping until exit from function main,
which has no line number information.
但在您的情况下,它也不能做到这一点--它不知道您所在的函数。
TL;DR:在没有文件/行信息的情况下调试程序集时,使用nexti
而不是next
,使用stepi
而不是step
。
https://stackoverflow.com/questions/69505747
复制相似问题