1

I am self-study mit6.s081, a gdb problem has bothered me for a few days so that my lab1 has not been completed yet. The following is a description of my problem:

I make qemu and gdb-multiarch in two windows, file user/_primes in the gdb window (this is the primes program of lab1, this program has passed the grade, it should be correct), then b main , then continue , but Later, when I was n , 0x0000000000000c10 in ?? ()=> 0x0000000000000c10: 1d 71 addi sp,sp,-96 appeared firstly,

n again

“cannot find bounds of current function” appeared later.

I tried to debug other programs, such as pingpong. After a few steps, cannot find bounds like primes, but sometimes n will enter user/ulib.c. When I debug the find program that I wrote, b main and then continue, the terminal does not respond directly, I am very puzzled what is going on. Do you have any solutions?

Supplementary note: I actually do lab on the ubuntu 20.04 virtual machine. 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

if you have any advice ,please type here.Thanks in advance.

jam buck
  • 23
  • 4
  • You can check other post like [this](https://stackoverflow.com/questions/8741493/why-i-do-get-cannot-find-bound-of-current-function-when-i-overwrite-the-ret-ad) . As usually stated you may have an error that messed up stack. – Ptit Xav Oct 09 '21 at 10:33

1 Answers1

1

“cannot find bounds of current function”

This error means:

  • you asked GDB to advance to the next line (using next command)
  • GDB can't do that (your binary is compiled without file/line debug info)
  • normally under these conditions GDB would print:
Single stepping until exit from function main,
which has no line number information.

but in your case, it can't do that either -- it doesn't know what function you are in.

TL;DR: when debugging assembly without file/line info, use nexti instead of next and stepi instead of step.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362