.debug_line section

Programming, for all ages and all languages.
Post Reply
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

.debug_line section

Post by mcheung63 »

Hi, what these three numbers mean in .debug_line section in ELF file?

Image

thanks
from Peter
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: .debug_line section

Post 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?!
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: .debug_line section

Post by mcheung63 »

ok, i understand them now
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: .debug_line section

Post 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... :)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: .debug_line section

Post 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.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: .debug_line section

Post 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.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: .debug_line section

Post 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).
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: .debug_line section

Post 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
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: .debug_line section

Post 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!
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

.debug_line in Java

Post 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
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: .debug_line in Java

Post 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.
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: .debug_line in Java

Post 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
My OS is Perception.
Post Reply