Page 1 of 1

.debug_line section

Posted: Fri Dec 04, 2009 12:20 pm
by mcheung63
Hi, what these three numbers mean in .debug_line section in ELF file?

Image

thanks
from Peter

Re: .debug_line section

Posted: Fri Dec 04, 2009 12:30 pm
by Owen
Exactly what they say? I presume you begin at the start of the section and read it as a sort of bytecode.

Oh, and you're running as root?!

Re: .debug_line section

Posted: Fri Dec 04, 2009 1:00 pm
by mcheung63
ok, i understand them now

Re: .debug_line section

Posted: Fri Dec 04, 2009 3:55 pm
by neon
On an unrelated topic, whats up with the posting of huge images on forums? like this 1440x900 one? Id at least scale it down or something... :)

Re: .debug_line section

Posted: Fri Dec 04, 2009 9:37 pm
by Brynet-Inc
Owen wrote:Oh, and you're running as root?!
I think he's already been outed on this one a few times, he seems to avoid/ignore the issue.. kind of sad really.

Re: .debug_line section

Posted: Sat Dec 05, 2009 5:52 am
by Owen
Brynet-Inc wrote:
Owen wrote:Oh, and you're running as root?!
I think he's already been outed on this one a few times, he seems to avoid/ignore the issue.. kind of sad really.
Well, if he insists on running Linux like you would run Windows 9x... it's his choice.

Re: .debug_line section

Posted: Mon Dec 07, 2009 12:09 pm
by JamesM
Check the DWARF format that I linked you to. The debug_* sections use an special automaton to create the debug information (instead of storing it in a great big table). The lines you mentioned are detailing what that automaton is doing (advancing the line pointer, from one value to another).

Re: .debug_line section

Posted: Wed Dec 09, 2009 2:20 am
by mcheung63
Thank you so much James.
The automation is too complex for me. I am rewriting the dwarf.c from binutils to java, so peter-bochs can support single step trace in C level. Wherever you loaded the ELF (kernel/app), bochs can single step trace on it. I think it is a great feature for os developer.
thanks
from Peter

Re: .debug_line section

Posted: Wed Dec 09, 2009 7:07 am
by JamesM
mcheung63 wrote:Thank you so much James.
The automation is too complex for me. I am rewriting the dwarf.c from binutils to java, so peter-bochs can support single step trace in C level. Wherever you loaded the ELF (kernel/app), bochs can single step trace on it. I think it is a great feature for os developer.
thanks
from Peter
You won't manage that without grasping the concept of the automaton, because it's central to the DWARF standard!

.debug_line in Java

Posted: Wed Dec 09, 2009 10:03 pm
by mcheung63
Hi All
I rewrite the "-wL" part of binutil 2.20 into Java. http://code.google.com/p/peter-bochs/so ... fUtil.java
It can read the debug line information from an ELF file.

I need to make bochs able to disassemble in any memory location, then peter-bochs can support c level single step trace. Very helpful to debug my os app :)

thanks
from Peter

Re: .debug_line in Java

Posted: Thu Dec 10, 2009 8:02 am
by JamesM
mcheung63 wrote:http://code.google.com/p/peter-bochs/source/browse/trunk/peter-bochs-debugger/src/peter/elf/ElfUtil.java
Ewwwwwww. That is all.

Re: .debug_line in Java

Posted: Fri Dec 11, 2009 6:43 am
by AndrewAPrice
JamesM wrote:
mcheung63 wrote:http://code.google.com/p/peter-bochs/source/browse/trunk/peter-bochs-debugger/src/peter/elf/ElfUtil.java
Ewwwwwww. That is all.
That's not so bad. Try porting a compiler to a new architecture, and you have reference code that you know does something important but you have no clue how it does it because of obscure variable names and macros so you're really trusting that it work and you see:

Code: Select all

OBFUSTICATEDMESSOBFUSTICATEDMESSOBFU
STICATEDMESSOBFUSTICATEDMESSOBFUSTICA
TEDMESS/*FIX ME*/OBFUSTICATEDMESSOBFUS
TICATEDMESSOBFUSTICATEDMESS