Page 1 of 1
Finding EIP
Posted: Tue Aug 26, 2003 7:04 pm
by _krisp
Hi,
I am getting some errors in bochs and I was wondering how I can use the EIP information where it crashed to find out where in the source it points to Is this possible using objump?
Re:Finding EIP
Posted: Wed Aug 27, 2003 1:36 am
by Pype.Clicker
yes, you can of course use objdump to know where which function stands. However, i find it easier to ask the linker to generate a map of your kernel (add -Map kernel.map in the linker command line if you're using LD
), especially when the kernel is made up of several .o files (to identify which .o file is responsible for the error)
Once you got the faulty .o, what you can do is objdump -drS <file.o> | less and look for the faulty offset (that you must compute with eip-file.o.start)
'-d' is for disassemble, -r for 'show relocations' and -S for 'interleave with sources'
Make sure to also know the value of general registers. This will definitely help finding out what's wrong.
Re:Finding EIP
Posted: Wed Aug 27, 2003 5:22 pm
by Tim
addr2line -e exename works, too. Type in an address, it gives you the file and line information.