TartanLlama / minidbg

A mini x86 linux debugger for teaching purposes
MIT License
592 stars 104 forks source link

Cannot find function #10

Open guyuming76 opened 3 years ago

guyuming76 commented 3 years ago

i can use neither "next" nor "step".

image

image

guyuming76 commented 3 years ago

i think i found out what's wrong, i put all screenshots and dwarfdump here:https://gitee.com/guyuming76/personal/commit/2682be51caefd3d5e78793e3a81d019c41e180f4

there are two issues here:

  1. in debugger::initialise_load_address() , it get the first address from /proc/pid/maps, but that address is for minidbg code itself, in my case, i think it should find the line for the unwinding code image;
  2. the low and high for rangelist is 145 and 4534, which is 0x91 and 0x11b6, but according to the dwarfdump output, it should be 0x1125 and 0x11b6, which corresponds to (4534-145) and 4534, so the low and high for ranglist assignment can be wrong.

However, i had not modified the code to test my theory yet.

RENEEGAILP commented 3 years ago

I have noticed that you cannot try step or next unless you have set a breakpoint at some point in your source code and then hit that breakpoint(using continue) Once you do this, it allows you to step and next as expected When the main function ends and if you try to use next or step command it gives the same error

jianKangS1 commented 1 year ago

image i use tools dwarf and find that pc is too lagre, so i let pc minus the offset and it will be right

Luyoung0001 commented 4 months ago

image i use tools dwarf and find that pc is too lagre, so i let pc minus the offset and it will be right

that is right, I also noticed that