From: qinwei@sunnorth.com.cn
To: gdb@sourceware.org
Subject: Re: How to avoid "but contains no code." in command "info line"?
Date: Tue, 27 Mar 2007 04:08:00 -0000 [thread overview]
Message-ID: <OFF0EE9DA4.96D1CAE9-ON482572AB.00167B37-482572AB.0016BFD4@sunnorth.com.cn> (raw)
In-Reply-To: <20070323115751.GB27943@caradoc.them.org>
[-- Attachment #1: Type: text/plain, Size: 2399 bytes --]
> > In a assembly file 'a.s', we define two sections which have code both.
> > For example:
> >
> > line1: .section mysection
> > line2: load r4, [r3]
> > line3: jump func
> > ......
> >
> > line6: .text
> > line7: store r4, [r3]
> > line8: jump func
> > ......
> >
> > "info line a.s:7" will print both the begin and end address of the
line.
> > but "info line a.s:2" just print the begin address and "but contains
no
> > code."
> >
> > I trace the behavior of gdb (6.6 release) and find if the code is not
in
> > .text,
> > then it will not be put to the 'blockvector structure'
>
> Are you sure? It sounds to me like your assembler is not emitting the
> right debug info. GDB doesn't care what section lines are in.
Hi, I tested this on x86:
1, compile & dump:
gcc -o t -gstabs+ s2.s tp_bt1.c
objdump -dhs t &>log1
objdump -G t &>log2
2, debug:
(gdb) info line s2.s:2
Line 2 of "s2.s" is at address 0x8048490 but contains no code.
3, I trace gdb(6.6 release) behavior in 'find_pc_sect_symtab':
1934 ALL_SYMTABS (objfile, s)
(gdb)
1936 bv = BLOCKVECTOR (s);
(gdb)
1937 b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
(gdb)
1939 if (BLOCK_START (b) <= pc
(gdb) p/x *b
$1 = {
startaddr = 0x8048334,
endaddr = 0x8048340,
function = 0x0,
superblock = 0x0,
dict = 0x9931404,
language_specific = {
cplus_specific = {
namespace = 0x0
}
},
gcc_compile_flag = 0x0
}
(gdb)
because address 0x8048490 is not in [0x8048334, 0x8048340], so return
NULL.
4, See the stabs info:
Contents of .stab section:
Symnum n_type n_othr n_desc n_value n_strx String
-1 HdrSym 0 71 0000043c 1
0 SO 0 0 08048334 1 s2.s
1 SLINE 0 2 08048490 0
2 SLINE 0 3 08048495 0
3 SLINE 0 5 08048334 0
4 SLINE 0 6 08048339 0
5 SO 0 0 08048340 6
/home/qinwei/GJ283/code/build_linux/debug-gdb/
6 SO 0 0 08048340 53 tp_bt1.c
7 OPT 0 0 00000000 62 gcc2_compiled.
5, My question:
1, Does gdb create a 'block' range from [0x08048334, 0x08048340] according
to every
'SO' symbol here? And address 0x08048490 is not in the range(s2.s)?
2, How to solve the problem? (make 'line info' print both start & end
address)
Let linker to link 'my_section' in the proper ranges? Or other solutions?
[-- Attachment #2: tp_bt1.c --]
[-- Type: application/octet-stream, Size: 305 bytes --]
int
fun2 (int x, int y)
{
int z;
z = x * y;
return z;
}
int
fun1 (int k, int l)
{
int m, n;
int ret;
m = k - l;
n = k + l;
ret = fun2 (m, n);
return ret;
}
int
main (void)
{
int i = 200;
int j = 100;
int ret;
i = 300;
j = 400;
ret = fun1 (i, j);
return ret;
}
[-- Attachment #3: log1 --]
[-- Type: application/octet-stream, Size: 29875 bytes --]
t: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .interp 00000013 08048114 08048114 00000114 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .note.ABI-tag 00000020 08048128 08048128 00000128 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .hash 00000028 08048148 08048148 00000148 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .dynsym 00000050 08048170 08048170 00000170 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .dynstr 00000059 080481c0 080481c0 000001c0 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .gnu.version 0000000a 0804821a 0804821a 0000021a 2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .gnu.version_r 00000020 08048224 08048224 00000224 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .rel.dyn 00000008 08048244 08048244 00000244 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .rel.plt 00000008 0804824c 0804824c 0000024c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .init 00000017 08048254 08048254 00000254 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
10 .plt 00000020 0804826c 0804826c 0000026c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .text 00000204 0804828c 0804828c 0000028c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .my_section 0000000a 08048490 08048490 00000490 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
13 .fini 0000001a 0804849c 0804849c 0000049c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
14 .rodata 00000008 080484b8 080484b8 000004b8 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
15 .eh_frame 00000004 080484c0 080484c0 000004c0 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
16 .ctors 00000008 080494c4 080494c4 000004c4 2**2
CONTENTS, ALLOC, LOAD, DATA
17 .dtors 00000008 080494cc 080494cc 000004cc 2**2
CONTENTS, ALLOC, LOAD, DATA
18 .jcr 00000004 080494d4 080494d4 000004d4 2**2
CONTENTS, ALLOC, LOAD, DATA
19 .dynamic 000000c8 080494d8 080494d8 000004d8 2**2
CONTENTS, ALLOC, LOAD, DATA
20 .got 00000004 080495a0 080495a0 000005a0 2**2
CONTENTS, ALLOC, LOAD, DATA
21 .got.plt 00000010 080495a4 080495a4 000005a4 2**2
CONTENTS, ALLOC, LOAD, DATA
22 .data 0000000c 080495b4 080495b4 000005b4 2**2
CONTENTS, ALLOC, LOAD, DATA
23 .bss 00000004 080495c0 080495c0 000005c0 2**2
ALLOC
24 .stab 00000360 00000000 00000000 000005c0 2**2
CONTENTS, READONLY, DEBUGGING
25 .stabstr 0000043c 00000000 00000000 00000920 2**0
CONTENTS, READONLY, DEBUGGING
26 .comment 0000010e 00000000 00000000 00000d5c 2**0
CONTENTS, READONLY
Contents of section .interp:
8048114 2f6c6962 2f6c642d 6c696e75 782e736f /lib/ld-linux.so
8048124 2e3200 .2.
Contents of section .note.ABI-tag:
8048128 04000000 10000000 01000000 474e5500 ............GNU.
8048138 00000000 02000000 02000000 05000000 ................
Contents of section .hash:
8048148 03000000 05000000 04000000 01000000 ................
8048158 02000000 00000000 00000000 00000000 ................
8048168 00000000 03000000 ........
Contents of section .dynsym:
8048170 00000000 00000000 00000000 00000000 ................
8048180 3d000000 00000000 dd000000 12000000 =...............
8048190 2e000000 bc840408 04000000 11000f00 ................
80481a0 01000000 00000000 00000000 20000000 ............ ...
80481b0 15000000 00000000 00000000 20000000 ............ ...
Contents of section .dynstr:
80481c0 005f4a76 5f526567 69737465 72436c61 ._Jv_RegisterCla
80481d0 73736573 005f5f67 6d6f6e5f 73746172 sses.__gmon_star
80481e0 745f5f00 6c696263 2e736f2e 36005f49 t__.libc.so.6._I
80481f0 4f5f7374 64696e5f 75736564 005f5f6c O_stdin_used.__l
8048200 6962635f 73746172 745f6d61 696e0047 ibc_start_main.G
8048210 4c494243 5f322e30 00 LIBC_2.0.
Contents of section .gnu.version:
804821a 00000200 01000000 0000 ..........
Contents of section .gnu.version_r:
8048224 01000100 24000000 10000000 00000000 ....$...........
8048234 1069690d 00000200 4f000000 00000000 .ii.....O.......
Contents of section .rel.dyn:
8048244 a0950408 06040000 ........
Contents of section .rel.plt:
804824c b0950408 07010000 ........
Contents of section .init:
8048254 5589e583 ec08e851 000000e8 a4000000 U......Q........
8048264 e8030200 00c9c3 .......
Contents of section .plt:
804826c ff35a895 0408ff25 ac950408 00000000 .5.....%........
804827c ff25b095 04086800 000000e9 e0ffffff .%....h.........
Contents of section .text:
804828c 31ed5e89 e183e4f0 50545268 28840408 1.^.....PTRh(...
804829c 68d48304 08515668 85830408 e8cfffff h....QVh........
80482ac fff49090 5589e553 e8000000 005b81c3 ....U..S.....[..
80482bc eb120000 528b83fc ffffff85 c07402ff ....R........t..
80482cc d0585bc9 c3909090 5589e583 ec08803d .X[.....U......=
80482dc c0950408 00740feb 1f8d7600 83c004a3 .....t....v.....
80482ec bc950408 ffd2a1bc 9504088b 1085d275 ...............u
80482fc ebc605c0 95040801 c9c389f6 5589e583 ............U...
804830c ec08a1d4 94040885 c07419b8 00000000 .........t......
804831c 85c07410 83ec0c68 d4940408 ffd083c4 ..t....h........
804832c 108d7600 c9c39090 e81c0000 00e81700 ..v.............
804833c 00009090 5589e583 ec048b45 080faf45 ....U......E...E
804834c 0c8945fc 8b45fcc9 c35589e5 83ec0c8b ..E..E...U......
804835c 550c8b45 0829d089 45fc8b45 0c034508 U..E.)..E..E..E.
804836c 8945f8ff 75f8ff75 fce8c6ff ffff83c4 .E..u..u........
804837c 088945f4 8b45f4c9 c35589e5 83ec1883 ..E..E...U......
804838c e4f0b800 00000083 c00f83c0 0fc1e804 ................
804839c c1e00429 c4c745fc c8000000 c745f864 ...)..E......E.d
80483ac 000000c7 45fc2c01 0000c745 f8900100 ....E.,....E....
80483bc 00ff75f8 ff75fce8 8dffffff 83c40889 ..u..u..........
80483cc 45f48b45 f4c9c390 5589e557 565383ec E..E....U..WVS..
80483dc 0ce80000 00005b81 c3c21100 00e866fe ......[.......f.
80483ec ffff8d83 20ffffff 8d9320ff ffff8945 .... ..... ....E
80483fc f029d031 f6c1f802 39c67316 89d789f6 .).1....9.s.....
804840c ff14b28b 4df029f9 46c1f902 39ce89fa ....M.).F...9...
804841c 72ee83c4 0c5b5e5f c9c389f6 5589e557 r....[^_....U..W
804842c 5653e800 0000005b 81c37111 00008d83 VS.....[..q.....
804843c 20ffffff 8dbb20ff ffff29f8 c1f80283 ..... ...).....
804844c ec0c8d70 ffeb0590 ff14b74e 83feff75 ...p.......N...u
804845c f7e83a00 000083c4 0c5b5e5f c9c39090 ..:......[^_....
804846c 5589e553 52bbc494 0408a1c4 940408eb U..SR...........
804847c 0a8d7600 83eb04ff d08b0383 f8ff75f4 ..v...........u.
804848c 585bc9c3 X[..
Contents of section .my_section:
8048490 e8abfeff ffe8a6fe ffff ..........
Contents of section .fini:
804849c 5589e553 e8000000 005b81c3 ff100000 U..S.....[......
80484ac 50e822fe ffff595b c9c3 P."...Y[..
Contents of section .rodata:
80484b8 03000000 01000200 ........
Contents of section .eh_frame:
80484c0 00000000 ....
Contents of section .ctors:
80494c4 ffffffff 00000000 ........
Contents of section .dtors:
80494cc ffffffff 00000000 ........
Contents of section .jcr:
80494d4 00000000 ....
Contents of section .dynamic:
80494d8 01000000 24000000 0c000000 54820408 ....$.......T...
80494e8 0d000000 9c840408 04000000 48810408 ............H...
80494f8 05000000 c0810408 06000000 70810408 ............p...
8049508 0a000000 59000000 0b000000 10000000 ....Y...........
8049518 15000000 00000000 03000000 a4950408 ................
8049528 02000000 08000000 14000000 11000000 ................
8049538 17000000 4c820408 11000000 44820408 ....L.......D...
8049548 12000000 08000000 13000000 08000000 ................
8049558 feffff6f 24820408 ffffff6f 01000000 ...o$......o....
8049568 f0ffff6f 1a820408 00000000 00000000 ...o............
8049578 00000000 00000000 00000000 00000000 ................
8049588 00000000 00000000 00000000 00000000 ................
8049598 00000000 00000000 ........
Contents of section .got:
80495a0 00000000 ....
Contents of section .got.plt:
80495a4 d8940408 00000000 00000000 82820408 ................
Contents of section .data:
80495b4 00000000 00000000 d0940408 ............
Contents of section .stab:
0000 01000000 00004700 3c040000 01000000 ......G.<.......
0010 64000000 34830408 00000000 44000200 d...4.......D...
0020 90840408 00000000 44000300 95840408 ........D.......
0030 00000000 44000500 34830408 00000000 ....D...4.......
0040 44000600 39830408 06000000 64000000 D...9.......d...
0050 40830408 35000000 64000000 40830408 @...5...d...@...
0060 3e000000 3c000000 00000000 4d000000 >...<.......M...
0070 80000000 00000000 77000000 80000000 ........w.......
0080 00000000 91000000 80000000 00000000 ................
0090 c0000000 80000000 00000000 f8000000 ................
00a0 80000000 00000000 35010000 80000000 ........5.......
00b0 00000000 86010000 80000000 00000000 ................
00c0 d7010000 80000000 00000000 02020000 ................
00d0 80000000 00000000 31020000 80000000 ........1.......
00e0 00000000 5b020000 80000000 00000000 ....[...........
00f0 84020000 80000000 00000000 9e020000 ................
0100 80000000 00000000 b9020000 80000000 ................
0110 00000000 da020000 80000000 00000000 ................
0120 13030000 80000000 00000000 31030000 ............1...
0130 80000000 00000000 51030000 80000000 ........Q.......
0140 00000000 76030000 80000000 00000000 ....v...........
0150 8a030000 80000000 00000000 ab030000 ................
0160 80000000 00000000 c2030000 24000300 ............$...
0170 40830408 ce030000 a0000200 08000000 @...............
0180 d7030000 a0000200 0c000000 00000000 ................
0190 44000300 00000000 00000000 44000500 D...........D...
01a0 06000000 00000000 44000600 10000000 ........D.......
01b0 00000000 44000700 13000000 e0030000 ....D...........
01c0 80000400 fcffffff 00000000 c0000000 ................
01d0 00000000 00000000 e0000000 15000000 ................
01e0 00000000 24000000 15000000 e8030000 ....$...........
01f0 24000b00 55830408 f4030000 a0000a00 $...U...........
0200 08000000 fd030000 a0000a00 0c000000 ................
0210 00000000 44000b00 00000000 00000000 ....D...........
0220 44000e00 06000000 00000000 44000f00 D...........D...
0230 11000000 00000000 44001000 1a000000 ........D.......
0240 00000000 44001100 2b000000 00000000 ....D...+.......
0250 44001200 2e000000 06040000 80000c00 D...............
0260 fcffffff 0e040000 80000c00 f8ffffff ................
0270 16040000 80000d00 f4ffffff 00000000 ................
0280 c0000000 00000000 00000000 e0000000 ................
0290 30000000 00000000 24000000 30000000 0.......$...0...
02a0 20040000 24001600 85830408 00000000 ...$...........
02b0 44001600 00000000 00000000 44001800 D...........D...
02c0 1c000000 00000000 44001900 23000000 ........D...#...
02d0 00000000 44001b00 2a000000 00000000 ....D...*.......
02e0 44001c00 31000000 00000000 44001d00 D...1.......D...
02f0 38000000 00000000 44001e00 49000000 8.......D...I...
0300 00000000 44001f00 4c000000 2c040000 ....D...L...,...
0310 80001800 fcffffff 34040000 80001900 ........4.......
0320 f8ffffff 16040000 80001a00 f4ffffff ................
0330 00000000 c0000000 00000000 00000000 ................
0340 e0000000 4e000000 00000000 24000000 ....N.......$...
0350 4e000000 00000000 64000000 d3830408 N.......d.......
Contents of section .stabstr:
0000 0073322e 73002f68 6f6d652f 71696e77 .s2.s./home/qinw
0010 65692f47 4a323833 2f636f64 652f6275 ei/GJ283/code/bu
0020 696c645f 6c696e75 782f6465 6275672d ild_linux/debug-
0030 6764622f 0074705f 6274312e 63006763 gdb/.tp_bt1.c.gc
0040 63325f63 6f6d7069 6c65642e 00696e74 c2_compiled..int
0050 3a742830 2c31293d 7228302c 31293b2d :t(0,1)=r(0,1);-
0060 32313437 34383336 34383b32 31343734 2147483648;21474
0070 38333634 373b0063 6861723a 7428302c 83647;.char:t(0,
0080 32293d72 28302c32 293b303b 3132373b 2)=r(0,2);0;127;
0090 006c6f6e 6720696e 743a7428 302c3329 .long int:t(0,3)
00a0 3d722830 2c33293b 2d323134 37343833 =r(0,3);-2147483
00b0 3634383b 32313437 34383336 34373b00 648;2147483647;.
00c0 756e7369 676e6564 20696e74 3a742830 unsigned int:t(0
00d0 2c34293d 7228302c 34293b30 30303030 ,4)=r(0,4);00000
00e0 30303030 30303030 3b303033 37373737 00000000;0037777
00f0 37373737 37373b00 6c6f6e67 20756e73 777777;.long uns
0100 69676e65 6420696e 743a7428 302c3529 igned int:t(0,5)
0110 3d722830 2c35293b 30303030 30303030 =r(0,5);00000000
0120 30303030 303b3030 33373737 37373737 00000;0037777777
0130 3737373b 006c6f6e 67206c6f 6e672069 777;.long long i
0140 6e743a74 28302c36 293d4073 36343b72 nt:t(0,6)=@s64;r
0150 28302c36 293b3031 30303030 30303030 (0,6);0100000000
0160 30303030 30303030 30303030 303b3037 0000000000000;07
0170 37373737 37373737 37373737 37373737 7777777777777777
0180 37373737 3b006c6f 6e67206c 6f6e6720 7777;.long long
0190 756e7369 676e6564 20696e74 3a742830 unsigned int:t(0
01a0 2c37293d 40733634 3b722830 2c37293b ,7)=@s64;r(0,7);
01b0 30303030 30303030 30303030 303b3031 0000000000000;01
01c0 37373737 37373737 37373737 37373737 7777777777777777
01d0 37373737 373b0073 686f7274 20696e74 77777;.short int
01e0 3a742830 2c38293d 40733136 3b722830 :t(0,8)=@s16;r(0
01f0 2c38293b 2d333237 36383b33 32373637 ,8);-32768;32767
0200 3b007368 6f727420 756e7369 676e6564 ;.short unsigned
0210 20696e74 3a742830 2c39293d 40733136 int:t(0,9)=@s16
0220 3b722830 2c39293b 303b3635 3533353b ;r(0,9);0;65535;
0230 00736967 6e656420 63686172 3a742830 .signed char:t(0
0240 2c313029 3d407338 3b722830 2c313029 ,10)=@s8;r(0,10)
0250 3b2d3132 383b3132 373b0075 6e736967 ;-128;127;.unsig
0260 6e656420 63686172 3a742830 2c313129 ned char:t(0,11)
0270 3d407338 3b722830 2c313129 3b303b32 =@s8;r(0,11);0;2
0280 35353b00 666c6f61 743a7428 302c3132 55;.float:t(0,12
0290 293d7228 302c3129 3b343b30 3b00646f )=r(0,1);4;0;.do
02a0 75626c65 3a742830 2c313329 3d722830 uble:t(0,13)=r(0
02b0 2c31293b 383b303b 006c6f6e 6720646f ,1);8;0;.long do
02c0 75626c65 3a742830 2c313429 3d722830 uble:t(0,14)=r(0
02d0 2c31293b 31323b30 3b00636f 6d706c65 ,1);12;0;.comple
02e0 7820696e 743a7428 302c3135 293d7338 x int:t(0,15)=s8
02f0 7265616c 3a28302c 31292c30 2c33323b real:(0,1),0,32;
0300 696d6167 3a28302c 31292c33 322c3332 imag:(0,1),32,32
0310 3b3b0063 6f6d706c 65782066 6c6f6174 ;;.complex float
0320 3a742830 2c313629 3d52333b 383b303b :t(0,16)=R3;8;0;
0330 00636f6d 706c6578 20646f75 626c653a .complex double:
0340 7428302c 3137293d 52333b31 363b303b t(0,17)=R3;16;0;
0350 00636f6d 706c6578 206c6f6e 6720646f .complex long do
0360 75626c65 3a742830 2c313829 3d52333b uble:t(0,18)=R3;
0370 32343b30 3b00766f 69643a74 28302c31 24;0;.void:t(0,1
0380 39293d28 302c3139 29005f5f 6275696c 9)=(0,19).__buil
0390 74696e5f 76615f6c 6973743a 7428302c tin_va_list:t(0,
03a0 3230293d 2a28302c 3229005f 426f6f6c 20)=*(0,2)._Bool
03b0 3a742830 2c323129 3d407338 3b2d3136 :t(0,21)=@s8;-16
03c0 3b006675 6e323a46 28302c31 2900783a ;.fun2:F(0,1).x:
03d0 7028302c 31290079 3a702830 2c312900 p(0,1).y:p(0,1).
03e0 7a3a2830 2c312900 66756e31 3a462830 z:(0,1).fun1:F(0
03f0 2c312900 6b3a7028 302c3129 006c3a70 ,1).k:p(0,1).l:p
0400 28302c31 29006d3a 28302c31 29006e3a (0,1).m:(0,1).n:
0410 28302c31 29007265 743a2830 2c312900 (0,1).ret:(0,1).
0420 6d61696e 3a462830 2c312900 693a2830 main:F(0,1).i:(0
0430 2c312900 6a3a2830 2c312900 ,1).j:(0,1).
Contents of section .comment:
0000 00474343 3a202847 4e552920 332e342e .GCC: (GNU) 3.4.
0010 36203230 30363034 30342028 52656420 6 20060404 (Red
0020 48617420 332e342e 362d3229 00004743 Hat 3.4.6-2)..GC
0030 433a2028 474e5529 20332e34 2e362032 C: (GNU) 3.4.6 2
0040 30303630 34303420 28526564 20486174 0060404 (Red Hat
0050 20332e34 2e362d32 29000047 43433a20 3.4.6-2)..GCC:
0060 28474e55 2920332e 342e3620 32303036 (GNU) 3.4.6 2006
0070 30343034 20285265 64204861 7420332e 0404 (Red Hat 3.
0080 342e362d 33290000 4743433a 2028474e 4.6-3)..GCC: (GN
0090 55292033 2e342e36 20323030 36303430 U) 3.4.6 2006040
00a0 34202852 65642048 61742033 2e342e36 4 (Red Hat 3.4.6
00b0 2d332900 00474343 3a202847 4e552920 -3)..GCC: (GNU)
00c0 332e342e 36203230 30363034 30342028 3.4.6 20060404 (
00d0 52656420 48617420 332e342e 362d3329 Red Hat 3.4.6-3)
00e0 00004743 433a2028 474e5529 20332e34 ..GCC: (GNU) 3.4
00f0 2e362032 30303630 34303420 28526564 .6 20060404 (Red
0100 20486174 20332e34 2e362d32 2900 Hat 3.4.6-2).
Disassembly of section .init:
08048254 <_init>:
8048254: 55 push %ebp
8048255: 89 e5 mov %esp,%ebp
8048257: 83 ec 08 sub $0x8,%esp
804825a: e8 51 00 00 00 call 80482b0 <call_gmon_start>
804825f: e8 a4 00 00 00 call 8048308 <frame_dummy>
8048264: e8 03 02 00 00 call 804846c <__do_global_ctors_aux>
8048269: c9 leave
804826a: c3 ret
Disassembly of section .plt:
0804826c <__libc_start_main@plt-0x10>:
804826c: ff 35 a8 95 04 08 pushl 0x80495a8
8048272: ff 25 ac 95 04 08 jmp *0x80495ac
8048278: 00 00 add %al,(%eax)
...
0804827c <__libc_start_main@plt>:
804827c: ff 25 b0 95 04 08 jmp *0x80495b0
8048282: 68 00 00 00 00 push $0x0
8048287: e9 e0 ff ff ff jmp 804826c <_init+0x18>
Disassembly of section .text:
0804828c <_start>:
804828c: 31 ed xor %ebp,%ebp
804828e: 5e pop %esi
804828f: 89 e1 mov %esp,%ecx
8048291: 83 e4 f0 and $0xfffffff0,%esp
8048294: 50 push %eax
8048295: 54 push %esp
8048296: 52 push %edx
8048297: 68 28 84 04 08 push $0x8048428
804829c: 68 d4 83 04 08 push $0x80483d4
80482a1: 51 push %ecx
80482a2: 56 push %esi
80482a3: 68 85 83 04 08 push $0x8048385
80482a8: e8 cf ff ff ff call 804827c <__libc_start_main@plt>
80482ad: f4 hlt
80482ae: 90 nop
80482af: 90 nop
080482b0 <call_gmon_start>:
80482b0: 55 push %ebp
80482b1: 89 e5 mov %esp,%ebp
80482b3: 53 push %ebx
80482b4: e8 00 00 00 00 call 80482b9 <call_gmon_start+0x9>
80482b9: 5b pop %ebx
80482ba: 81 c3 eb 12 00 00 add $0x12eb,%ebx
80482c0: 52 push %edx
80482c1: 8b 83 fc ff ff ff mov 0xfffffffc(%ebx),%eax
80482c7: 85 c0 test %eax,%eax
80482c9: 74 02 je 80482cd <call_gmon_start+0x1d>
80482cb: ff d0 call *%eax
80482cd: 58 pop %eax
80482ce: 5b pop %ebx
80482cf: c9 leave
80482d0: c3 ret
80482d1: 90 nop
80482d2: 90 nop
80482d3: 90 nop
080482d4 <__do_global_dtors_aux>:
80482d4: 55 push %ebp
80482d5: 89 e5 mov %esp,%ebp
80482d7: 83 ec 08 sub $0x8,%esp
80482da: 80 3d c0 95 04 08 00 cmpb $0x0,0x80495c0
80482e1: 74 0f je 80482f2 <__do_global_dtors_aux+0x1e>
80482e3: eb 1f jmp 8048304 <__do_global_dtors_aux+0x30>
80482e5: 8d 76 00 lea 0x0(%esi),%esi
80482e8: 83 c0 04 add $0x4,%eax
80482eb: a3 bc 95 04 08 mov %eax,0x80495bc
80482f0: ff d2 call *%edx
80482f2: a1 bc 95 04 08 mov 0x80495bc,%eax
80482f7: 8b 10 mov (%eax),%edx
80482f9: 85 d2 test %edx,%edx
80482fb: 75 eb jne 80482e8 <__do_global_dtors_aux+0x14>
80482fd: c6 05 c0 95 04 08 01 movb $0x1,0x80495c0
8048304: c9 leave
8048305: c3 ret
8048306: 89 f6 mov %esi,%esi
08048308 <frame_dummy>:
8048308: 55 push %ebp
8048309: 89 e5 mov %esp,%ebp
804830b: 83 ec 08 sub $0x8,%esp
804830e: a1 d4 94 04 08 mov 0x80494d4,%eax
8048313: 85 c0 test %eax,%eax
8048315: 74 19 je 8048330 <frame_dummy+0x28>
8048317: b8 00 00 00 00 mov $0x0,%eax
804831c: 85 c0 test %eax,%eax
804831e: 74 10 je 8048330 <frame_dummy+0x28>
8048320: 83 ec 0c sub $0xc,%esp
8048323: 68 d4 94 04 08 push $0x80494d4
8048328: ff d0 call *%eax
804832a: 83 c4 10 add $0x10,%esp
804832d: 8d 76 00 lea 0x0(%esi),%esi
8048330: c9 leave
8048331: c3 ret
8048332: 90 nop
8048333: 90 nop
8048334: e8 1c 00 00 00 call 8048355 <fun1>
8048339: e8 17 00 00 00 call 8048355 <fun1>
804833e: 90 nop
804833f: 90 nop
08048340 <fun2>:
8048340: 55 push %ebp
8048341: 89 e5 mov %esp,%ebp
8048343: 83 ec 04 sub $0x4,%esp
8048346: 8b 45 08 mov 0x8(%ebp),%eax
8048349: 0f af 45 0c imul 0xc(%ebp),%eax
804834d: 89 45 fc mov %eax,0xfffffffc(%ebp)
8048350: 8b 45 fc mov 0xfffffffc(%ebp),%eax
8048353: c9 leave
8048354: c3 ret
08048355 <fun1>:
8048355: 55 push %ebp
8048356: 89 e5 mov %esp,%ebp
8048358: 83 ec 0c sub $0xc,%esp
804835b: 8b 55 0c mov 0xc(%ebp),%edx
804835e: 8b 45 08 mov 0x8(%ebp),%eax
8048361: 29 d0 sub %edx,%eax
8048363: 89 45 fc mov %eax,0xfffffffc(%ebp)
8048366: 8b 45 0c mov 0xc(%ebp),%eax
8048369: 03 45 08 add 0x8(%ebp),%eax
804836c: 89 45 f8 mov %eax,0xfffffff8(%ebp)
804836f: ff 75 f8 pushl 0xfffffff8(%ebp)
8048372: ff 75 fc pushl 0xfffffffc(%ebp)
8048375: e8 c6 ff ff ff call 8048340 <fun2>
804837a: 83 c4 08 add $0x8,%esp
804837d: 89 45 f4 mov %eax,0xfffffff4(%ebp)
8048380: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
8048383: c9 leave
8048384: c3 ret
08048385 <main>:
8048385: 55 push %ebp
8048386: 89 e5 mov %esp,%ebp
8048388: 83 ec 18 sub $0x18,%esp
804838b: 83 e4 f0 and $0xfffffff0,%esp
804838e: b8 00 00 00 00 mov $0x0,%eax
8048393: 83 c0 0f add $0xf,%eax
8048396: 83 c0 0f add $0xf,%eax
8048399: c1 e8 04 shr $0x4,%eax
804839c: c1 e0 04 shl $0x4,%eax
804839f: 29 c4 sub %eax,%esp
80483a1: c7 45 fc c8 00 00 00 movl $0xc8,0xfffffffc(%ebp)
80483a8: c7 45 f8 64 00 00 00 movl $0x64,0xfffffff8(%ebp)
80483af: c7 45 fc 2c 01 00 00 movl $0x12c,0xfffffffc(%ebp)
80483b6: c7 45 f8 90 01 00 00 movl $0x190,0xfffffff8(%ebp)
80483bd: ff 75 f8 pushl 0xfffffff8(%ebp)
80483c0: ff 75 fc pushl 0xfffffffc(%ebp)
80483c3: e8 8d ff ff ff call 8048355 <fun1>
80483c8: 83 c4 08 add $0x8,%esp
80483cb: 89 45 f4 mov %eax,0xfffffff4(%ebp)
80483ce: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
80483d1: c9 leave
80483d2: c3 ret
80483d3: 90 nop
080483d4 <__libc_csu_init>:
80483d4: 55 push %ebp
80483d5: 89 e5 mov %esp,%ebp
80483d7: 57 push %edi
80483d8: 56 push %esi
80483d9: 53 push %ebx
80483da: 83 ec 0c sub $0xc,%esp
80483dd: e8 00 00 00 00 call 80483e2 <__libc_csu_init+0xe>
80483e2: 5b pop %ebx
80483e3: 81 c3 c2 11 00 00 add $0x11c2,%ebx
80483e9: e8 66 fe ff ff call 8048254 <_init>
80483ee: 8d 83 20 ff ff ff lea 0xffffff20(%ebx),%eax
80483f4: 8d 93 20 ff ff ff lea 0xffffff20(%ebx),%edx
80483fa: 89 45 f0 mov %eax,0xfffffff0(%ebp)
80483fd: 29 d0 sub %edx,%eax
80483ff: 31 f6 xor %esi,%esi
8048401: c1 f8 02 sar $0x2,%eax
8048404: 39 c6 cmp %eax,%esi
8048406: 73 16 jae 804841e <__libc_csu_init+0x4a>
8048408: 89 d7 mov %edx,%edi
804840a: 89 f6 mov %esi,%esi
804840c: ff 14 b2 call *(%edx,%esi,4)
804840f: 8b 4d f0 mov 0xfffffff0(%ebp),%ecx
8048412: 29 f9 sub %edi,%ecx
8048414: 46 inc %esi
8048415: c1 f9 02 sar $0x2,%ecx
8048418: 39 ce cmp %ecx,%esi
804841a: 89 fa mov %edi,%edx
804841c: 72 ee jb 804840c <__libc_csu_init+0x38>
804841e: 83 c4 0c add $0xc,%esp
8048421: 5b pop %ebx
8048422: 5e pop %esi
8048423: 5f pop %edi
8048424: c9 leave
8048425: c3 ret
8048426: 89 f6 mov %esi,%esi
08048428 <__libc_csu_fini>:
8048428: 55 push %ebp
8048429: 89 e5 mov %esp,%ebp
804842b: 57 push %edi
804842c: 56 push %esi
804842d: 53 push %ebx
804842e: e8 00 00 00 00 call 8048433 <__libc_csu_fini+0xb>
8048433: 5b pop %ebx
8048434: 81 c3 71 11 00 00 add $0x1171,%ebx
804843a: 8d 83 20 ff ff ff lea 0xffffff20(%ebx),%eax
8048440: 8d bb 20 ff ff ff lea 0xffffff20(%ebx),%edi
8048446: 29 f8 sub %edi,%eax
8048448: c1 f8 02 sar $0x2,%eax
804844b: 83 ec 0c sub $0xc,%esp
804844e: 8d 70 ff lea 0xffffffff(%eax),%esi
8048451: eb 05 jmp 8048458 <__libc_csu_fini+0x30>
8048453: 90 nop
8048454: ff 14 b7 call *(%edi,%esi,4)
8048457: 4e dec %esi
8048458: 83 fe ff cmp $0xffffffff,%esi
804845b: 75 f7 jne 8048454 <__libc_csu_fini+0x2c>
804845d: e8 3a 00 00 00 call 804849c <_fini>
8048462: 83 c4 0c add $0xc,%esp
8048465: 5b pop %ebx
8048466: 5e pop %esi
8048467: 5f pop %edi
8048468: c9 leave
8048469: c3 ret
804846a: 90 nop
804846b: 90 nop
0804846c <__do_global_ctors_aux>:
804846c: 55 push %ebp
804846d: 89 e5 mov %esp,%ebp
804846f: 53 push %ebx
8048470: 52 push %edx
8048471: bb c4 94 04 08 mov $0x80494c4,%ebx
8048476: a1 c4 94 04 08 mov 0x80494c4,%eax
804847b: eb 0a jmp 8048487 <__do_global_ctors_aux+0x1b>
804847d: 8d 76 00 lea 0x0(%esi),%esi
8048480: 83 eb 04 sub $0x4,%ebx
8048483: ff d0 call *%eax
8048485: 8b 03 mov (%ebx),%eax
8048487: 83 f8 ff cmp $0xffffffff,%eax
804848a: 75 f4 jne 8048480 <__do_global_ctors_aux+0x14>
804848c: 58 pop %eax
804848d: 5b pop %ebx
804848e: c9 leave
804848f: c3 ret
Disassembly of section .my_section:
08048490 <.my_section>:
8048490: e8 ab fe ff ff call 8048340 <fun2>
8048495: e8 a6 fe ff ff call 8048340 <fun2>
Disassembly of section .fini:
0804849c <_fini>:
804849c: 55 push %ebp
804849d: 89 e5 mov %esp,%ebp
804849f: 53 push %ebx
80484a0: e8 00 00 00 00 call 80484a5 <_fini+0x9>
80484a5: 5b pop %ebx
80484a6: 81 c3 ff 10 00 00 add $0x10ff,%ebx
80484ac: 50 push %eax
80484ad: e8 22 fe ff ff call 80482d4 <__do_global_dtors_aux>
80484b2: 59 pop %ecx
80484b3: 5b pop %ebx
80484b4: c9 leave
80484b5: c3 ret
[-- Attachment #4: log2 --]
[-- Type: application/octet-stream, Size: 4406 bytes --]
t: file format elf32-i386
Contents of .stab section:
Symnum n_type n_othr n_desc n_value n_strx String
-1 HdrSym 0 71 0000043c 1
0 SO 0 0 08048334 1 s2.s
1 SLINE 0 2 08048490 0
2 SLINE 0 3 08048495 0
3 SLINE 0 5 08048334 0
4 SLINE 0 6 08048339 0
5 SO 0 0 08048340 6 /home/qinwei/GJ283/code/build_linux/debug-gdb/
6 SO 0 0 08048340 53 tp_bt1.c
7 OPT 0 0 00000000 62 gcc2_compiled.
8 LSYM 0 0 00000000 77 int:t(0,1)=r(0,1);-2147483648;2147483647;
9 LSYM 0 0 00000000 119 char:t(0,2)=r(0,2);0;127;
10 LSYM 0 0 00000000 145 long int:t(0,3)=r(0,3);-2147483648;2147483647;
11 LSYM 0 0 00000000 192 unsigned int:t(0,4)=r(0,4);0000000000000;0037777777777;
12 LSYM 0 0 00000000 248 long unsigned int:t(0,5)=r(0,5);0000000000000;0037777777777;
13 LSYM 0 0 00000000 309 long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;
14 LSYM 0 0 00000000 390 long long unsigned int:t(0,7)=@s64;r(0,7);0000000000000;01777777777777777777777;
15 LSYM 0 0 00000000 471 short int:t(0,8)=@s16;r(0,8);-32768;32767;
16 LSYM 0 0 00000000 514 short unsigned int:t(0,9)=@s16;r(0,9);0;65535;
17 LSYM 0 0 00000000 561 signed char:t(0,10)=@s8;r(0,10);-128;127;
18 LSYM 0 0 00000000 603 unsigned char:t(0,11)=@s8;r(0,11);0;255;
19 LSYM 0 0 00000000 644 float:t(0,12)=r(0,1);4;0;
20 LSYM 0 0 00000000 670 double:t(0,13)=r(0,1);8;0;
21 LSYM 0 0 00000000 697 long double:t(0,14)=r(0,1);12;0;
22 LSYM 0 0 00000000 730 complex int:t(0,15)=s8real:(0,1),0,32;imag:(0,1),32,32;;
23 LSYM 0 0 00000000 787 complex float:t(0,16)=R3;8;0;
24 LSYM 0 0 00000000 817 complex double:t(0,17)=R3;16;0;
25 LSYM 0 0 00000000 849 complex long double:t(0,18)=R3;24;0;
26 LSYM 0 0 00000000 886 void:t(0,19)=(0,19)
27 LSYM 0 0 00000000 906 __builtin_va_list:t(0,20)=*(0,2)
28 LSYM 0 0 00000000 939 _Bool:t(0,21)=@s8;-16;
29 FUN 0 3 08048340 962 fun2:F(0,1)
30 PSYM 0 2 00000008 974 x:p(0,1)
31 PSYM 0 2 0000000c 983 y:p(0,1)
32 SLINE 0 3 00000000 0
33 SLINE 0 5 00000006 0
34 SLINE 0 6 00000010 0
35 SLINE 0 7 00000013 0
36 LSYM 0 4 fffffffc 992 z:(0,1)
37 LBRAC 0 0 00000000 0
38 RBRAC 0 0 00000015 0
39 FUN 0 0 00000015 0
40 FUN 0 11 08048355 1000 fun1:F(0,1)
41 PSYM 0 10 00000008 1012 k:p(0,1)
42 PSYM 0 10 0000000c 1021 l:p(0,1)
43 SLINE 0 11 00000000 0
44 SLINE 0 14 00000006 0
45 SLINE 0 15 00000011 0
46 SLINE 0 16 0000001a 0
47 SLINE 0 17 0000002b 0
48 SLINE 0 18 0000002e 0
49 LSYM 0 12 fffffffc 1030 m:(0,1)
50 LSYM 0 12 fffffff8 1038 n:(0,1)
51 LSYM 0 13 fffffff4 1046 ret:(0,1)
52 LBRAC 0 0 00000000 0
53 RBRAC 0 0 00000030 0
54 FUN 0 0 00000030 0
55 FUN 0 22 08048385 1056 main:F(0,1)
56 SLINE 0 22 00000000 0
57 SLINE 0 24 0000001c 0
58 SLINE 0 25 00000023 0
59 SLINE 0 27 0000002a 0
60 SLINE 0 28 00000031 0
61 SLINE 0 29 00000038 0
62 SLINE 0 30 00000049 0
63 SLINE 0 31 0000004c 0
64 LSYM 0 24 fffffffc 1068 i:(0,1)
65 LSYM 0 25 fffffff8 1076 j:(0,1)
66 LSYM 0 26 fffffff4 1046 ret:(0,1)
67 LBRAC 0 0 00000000 0
68 RBRAC 0 0 0000004e 0
69 FUN 0 0 0000004e 0
70 SO 0 0 080483d3 0
[-- Attachment #5: s2.s --]
[-- Type: application/octet-stream, Size: 81 bytes --]
.section .my_section,"ax"
call fun2
call fun2
.text
call fun1
call fun1
next prev parent reply other threads:[~2007-03-27 4:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 7:22 qinwei
2007-03-23 11:58 ` Daniel Jacobowitz
2007-03-27 4:08 ` qinwei [this message]
2007-03-27 11:16 ` Daniel Jacobowitz
2007-03-28 2:46 ` qinwei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=OFF0EE9DA4.96D1CAE9-ON482572AB.00167B37-482572AB.0016BFD4@sunnorth.com.cn \
--to=qinwei@sunnorth.com.cn \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox