Hi All
I have a cross compiler gcc and compile my program with -g. If I
use my cross objdump to dump the output file, I saw the debug
information. But if I use dwarfdump to dump it, no information in
there.
compile by :
/Users/peter>i586-peter-elf-gcc -c -g a.c
objdump:
/Users/peter>i586-peter-elf-objdump -S a.o
a.o: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
int main(){
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 10 sub $0x10,%esp
int x=0;
6: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
for (x=0;x<10;x++){
d: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
14: eb 07 jmp 1d <main+0x1d>
x+=2;
16: 83 45 fc 02 addl $0x2,-0x4(%ebp)
int main(){
int x=0;
for (x=0;x<10;x++){
1a: ff 45 fc incl -0x4(%ebp)
1d: 83 7d fc 09 cmpl $0x9,-0x4(%ebp)
21: 7e f3 jle 16 <main+0x16>
x+=2;
}
return x;
23: 8b 45 fc mov -0x4(%ebp),%eax
}
26: c9 leave
27: c3 ret
dwarfdump:
/Users/peter>dwarfdump a.o
----------------------------------------------------------------------
File: a.o (i386)
----------------------------------------------------------------------
.debug_info contents:
< EMPTY >
thanks
from Peter (
cmk...@hotmail.com)