Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: qinwei<qinwei@sunnorth.com.cn>
To: gdb@sourceware.org
Subject: Re: How to avoid "but contains no code." in command "info line"?
Date: Wed, 28 Mar 2007 02:46:00 -0000	[thread overview]
Message-ID: <OFE445BFC3.D4ED4379-ON482572AC.000DD950-482572AC.000F2CCB@sunnorth.com.cn> (raw)
In-Reply-To: <20070327111627.GA15136@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

> You're using stabs.  Don't!  DWARF-2 works much better, especially for
> strange ranges and multiple sections.  If it still happens with
> DWARF-2 I can look into it, but I'm not interested in trying to fix
> this for stabs.

Hi, using DWARF-2 also has the problem. I use gcc-3.4 and gcc-4.0

gcc -o t -gdwarf-2 s2.s tp_bt1.c
objdump -dhs t &>log1
readelf --debug-dump t &>log2

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 *b
$1 = {
  startaddr = 0, 
  endaddr = 0, 
  function = 0x0, 
  superblock = 0x0, 
  dict = 0xa3317b4, 
  language_specific = {
    cplus_specific = {
      namespace = 0x0
    }
  }, 
  gcc_compile_flag = 2 '\002'
}
(gdb) 

The section .debug_aranges contains:

  Length:                   36
  Version:                  2
  Offset into .debug_info:  0
  Pointer Size:             4
  Segment Size:             0

    Address  Length
    08048334 10
    080484b4 10


[-- 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: 27333 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         00000224  08048290  08048290  00000290  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 .my_section   0000000a  080484b4  080484b4  000004b4  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 13 .fini         0000001a  080484c0  080484c0  000004c0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 14 .rodata       00000008  080484dc  080484dc  000004dc  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .eh_frame     00000004  080484e4  080484e4  000004e4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 16 .ctors        00000008  080494e8  080494e8  000004e8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 17 .dtors        00000008  080494f0  080494f0  000004f0  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 18 .jcr          00000004  080494f8  080494f8  000004f8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 19 .dynamic      000000c8  080494fc  080494fc  000004fc  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 20 .got          00000004  080495c4  080495c4  000005c4  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 21 .got.plt      00000010  080495c8  080495c8  000005c8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 22 .data         0000000c  080495d8  080495d8  000005d8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 23 .bss          00000004  080495e4  080495e4  000005e4  2**2
                  ALLOC
 24 .comment      000000bd  00000000  00000000  000005e4  2**0
                  CONTENTS, READONLY
 25 .debug_aranges 00000048  00000000  00000000  000006a8  2**3
                  CONTENTS, READONLY, DEBUGGING
 26 .debug_pubnames 0000002d  00000000  00000000  000006f0  2**0
                  CONTENTS, READONLY, DEBUGGING
 27 .debug_info   00000197  00000000  00000000  0000071d  2**0
                  CONTENTS, READONLY, DEBUGGING
 28 .debug_abbrev 0000007d  00000000  00000000  000008b4  2**0
                  CONTENTS, READONLY, DEBUGGING
 29 .debug_line   00000085  00000000  00000000  00000931  2**0
                  CONTENTS, READONLY, DEBUGGING
 30 .debug_frame  0000005c  00000000  00000000  000009b8  2**2
                  CONTENTS, READONLY, DEBUGGING
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 e0840408 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 c4950408 06040000                    ........        
Contents of section .rel.plt:
 804824c d4950408 07010000                    ........        
Contents of section .init:
 8048254 5589e583 ec08e855 000000e8 ac000000  U......U........
 8048264 e8170200 00c9c3                      .......         
Contents of section .plt:
 804826c ff35cc95 0408ff25 d0950408 00000000  .5.....%........
 804827c ff25d495 04086800 000000e9 e0ffffff  .%....h.........
Contents of section .text:
 8048290 31ed5e89 e183e4f0 50545268 30840408  1.^.....PTRh0...
 80482a0 68dc8304 08515668 89830408 e8cbffff  h....QVh........
 80482b0 fff49090 5589e553 e8000000 005b81c3  ....U..S.....[..
 80482c0 0b130000 528b83fc ffffff85 c07402ff  ....R........t..
 80482d0 d0585bc9 c3909090 90909090 90909090  .X[.............
 80482e0 5589e583 ec08803d e4950408 00740ceb  U......=.....t..
 80482f0 1c83c004 a3e09504 08ffd2a1 e0950408  ................
 8048300 8b1085d2 75ebc605 e4950408 01c9c390  ....u...........
 8048310 5589e583 ec08a1f8 94040885 c07412b8  U............t..
 8048320 00000000 85c07409 c70424f8 940408ff  ......t...$.....
 8048330 d0c9c390 e81c0000 00e81700 00009090  ................
 8048340 5589e583 ec108b45 080faf45 0c8945fc  U......E...E..E.
 8048350 8b45fcc9 c35589e5 83ec188b 550c8b45  .E...U......U..E
 8048360 0829d089 45f48b45 0c034508 8945f88b  .)..E..E..E..E..
 8048370 45f88944 24048b45 f4890424 e8bfffff  E..D$..E...$....
 8048380 ff8945fc 8b45fcc9 c35589e5 83ec1883  ..E..E...U......
 8048390 e4f0b800 00000083 c00f83c0 0fc1e804  ................
 80483a0 c1e00429 c4c745f4 c8000000 c745f864  ...)..E......E.d
 80483b0 000000c7 45f42c01 0000c745 f8900100  ....E.,....E....
 80483c0 008b45f8 89442404 8b45f489 0424e882  ..E..D$..E...$..
 80483d0 ffffff89 45fc8b45 fcc9c390 5589e557  ....E..E....U..W
 80483e0 565383ec 0ce80000 00005b81 c3de1100  VS........[.....
 80483f0 00e85efe ffff8d83 20ffffff 8d9320ff  ..^..... ..... .
 8048400 ffff8945 f029d031 f6c1f802 39c67316  ...E.).1....9.s.
 8048410 89d789f6 ff14b28b 4df029f9 46c1f902  ........M.).F...
 8048420 39ce89fa 72ee83c4 0c5b5e5f c9c389f6  9...r....[^_....
 8048430 5589e557 5653e800 0000005b 81c38d11  U..WVS.....[....
 8048440 00008d83 20ffffff 8dbb20ff ffff29f8  .... ..... ...).
 8048450 c1f80283 ec0c8d70 ffeb0590 ff14b74e  .......p.......N
 8048460 83feff75 f7e85600 000083c4 0c5b5e5f  ...u..V......[^_
 8048470 c9c39090 90909090 90909090 90909090  ................
 8048480 5589e553 83ec04a1 e8940408 83f8ff74  U..S...........t
 8048490 1cbbe894 04088d76 008dbc27 00000000  .......v...'....
 80484a0 ffd08b43 fc83eb04 83f8ff75 f3585b5d  ...C.......u.X[]
 80484b0 c3909090                             ....            
Contents of section .my_section:
 80484b4 e887feff ffe882fe ffff               ..........      
Contents of section .fini:
 80484c0 5589e553 e8000000 005b81c3 ff100000  U..S.....[......
 80484d0 50e80afe ffff595b c9c3               P.....Y[..      
Contents of section .rodata:
 80484dc 03000000 01000200                    ........        
Contents of section .eh_frame:
 80484e4 00000000                             ....            
Contents of section .ctors:
 80494e8 ffffffff 00000000                    ........        
Contents of section .dtors:
 80494f0 ffffffff 00000000                    ........        
Contents of section .jcr:
 80494f8 00000000                             ....            
Contents of section .dynamic:
 80494fc 01000000 24000000 0c000000 54820408  ....$.......T...
 804950c 0d000000 c0840408 04000000 48810408  ............H...
 804951c 05000000 c0810408 06000000 70810408  ............p...
 804952c 0a000000 59000000 0b000000 10000000  ....Y...........
 804953c 15000000 00000000 03000000 c8950408  ................
 804954c 02000000 08000000 14000000 11000000  ................
 804955c 17000000 4c820408 11000000 44820408  ....L.......D...
 804956c 12000000 08000000 13000000 08000000  ................
 804957c feffff6f 24820408 ffffff6f 01000000  ...o$......o....
 804958c f0ffff6f 1a820408 00000000 00000000  ...o............
 804959c 00000000 00000000 00000000 00000000  ................
 80495ac 00000000 00000000 00000000 00000000  ................
 80495bc 00000000 00000000                    ........        
Contents of section .got:
 80495c4 00000000                             ....            
Contents of section .got.plt:
 80495c8 fc940408 00000000 00000000 82820408  ................
Contents of section .data:
 80495d8 00000000 00000000 f4940408           ............    
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 2920342e 302e3200 00474343  (GNU) 4.0.2..GCC
 0070 3a202847 4e552920 342e302e 32000047  : (GNU) 4.0.2..G
 0080 43433a20 28474e55 2920342e 302e3200  CC: (GNU) 4.0.2.
 0090 00474343 3a202847 4e552920 332e342e  .GCC: (GNU) 3.4.
 00a0 36203230 30363034 30342028 52656420  6 20060404 (Red 
 00b0 48617420 332e342e 362d3229 00        Hat 3.4.6-2).   
Contents of section .debug_aranges:
 0000 24000000 02000000 00000400 00000000  $...............
 0010 34830408 0a000000 b4840408 0a000000  4...............
 0020 00000000 00000000 1c000000 02005800  ..............X.
 0030 00000400 00000000 40830408 9b000000  ........@.......
 0040 00000000 00000000                    ........        
Contents of section .debug_pubnames:
 0000 29000000 02005800 00003f01 00005c00  ).....X...?...\.
 0010 00006675 6e3200a4 00000066 756e3100  ..fun2.....fun1.
 0020 ff000000 6d61696e 00000000 00        ....main.....   
Contents of section .debug_info:
 0000 54000000 02000000 00000401 00000000  T...............
 0010 73322e73 002f686f 6d652f71 696e7765  s2.s./home/qinwe
 0020 692f474a 3238332f 636f6465 2f627569  i/GJ283/code/bui
 0030 6c645f6c 696e7578 2f646562 75672d67  ld_linux/debug-g
 0040 64620047 4e552041 5320322e 31352e39  db.GNU AS 2.15.9
 0050 322e302e 32000180 3b010000 02001000  2.0.2...;.......
 0060 00000401 3e000000 db830408 40830408  ....>.......@...
 0070 474e5520 4320342e 302e3200 0174705f  GNU C 4.0.2..tp_
 0080 6274312e 63002f68 6f6d652f 71696e77  bt1.c./home/qinw
 0090 65692f47 4a323833 2f636f64 652f6275  ei/GJ283/code/bu
 00a0 696c645f 6c696e75 782f6465 6275672d  ild_linux/debug-
 00b0 67646200 029d0000 00016675 6e320001  gdb.......fun2..
 00c0 03019d00 00004083 04085583 04080155  ......@...U....U
 00d0 03780001 029d0000 00027508 03790001  .x........u..y..
 00e0 029d0000 0002750c 047a0001 049d0000  ......u..z......
 00f0 0002757c 0005696e 74000405 02ff0000  ..u|..int.......
 0100 00016675 6e310001 0b019d00 00005583  ..fun1........U.
 0110 04088983 04080155 036b0001 0a9d0000  .......U.k......
 0120 00027508 036c0001 0a9d0000 0002750c  ..u..l........u.
 0130 046d0001 0c9d0000 00027574 046e0001  .m........ut.n..
 0140 0c9d0000 00027578 04726574 00010d9d  ......ux.ret....
 0150 00000002 757c0006 016d6169 6e000116  ....u|...main...
 0160 019d0000 00898304 08db8304 08015504  ..............U.
 0170 69000118 9d000000 02757404 6a000119  i........ut.j...
 0180 9d000000 02757804 72657400 011a9d00  .....ux.ret.....
 0190 00000275 7c0000                      ...u|..         
Contents of section .debug_abbrev:
 0000 01110010 0603081b 08250813 05000000  .........%......
 0010 01110110 06120111 01250813 0b03081b  .........%......
 0020 08000002 2e010113 3f0c0308 3a0b3b0b  ........?...:.;.
 0030 270c4913 11011201 400a0000 03050003  '.I.....@.......
 0040 083a0b3b 0b491302 0a000004 34000308  .:.;.I......4...
 0050 3a0b3b0b 4913020a 00000524 0003080b  :.;.I......$....
 0060 0b3e0b00 00062e01 3f0c0308 3a0b3b0b  .>......?...:.;.
 0070 270c4913 11011201 400a0000 00        '.I.....@....   
Contents of section .debug_line:
 0000 3a000000 02001800 00000101 fb0e0a00  :...............
 0010 01010101 00000001 0073322e 73000000  .........s2.s...
 0020 00000005 02348304 08135602 05000101  .....4....V.....
 0030 000502b4 84040810 56020500 01014300  ........V.....C.
 0040 00000200 1c000000 0101fb0e 0a000101  ................
 0050 01010000 00010074 705f6274 312e6300  .......tp_bt1.c.
 0060 00000000 00050240 83040811 659c3a2f  .......@....e.:/
 0070 66aa8e08 483a2f08 ab727372 7208483a  f...H:/..rsrr.H:
 0080 02020001 01                          .....           
Contents of section .debug_frame:
 0000 10000000 ffffffff 0100017c 080c0404  ...........|....
 0010 88010000 14000000 00000000 40830408  ............@...
 0020 15000000 410e0885 02420d05 14000000  ....A....B......
 0030 00000000 55830408 34000000 410e0885  ....U...4...A...
 0040 02420d05 14000000 00000000 89830408  .B..............
 0050 52000000 410e0885 02420d05           R...A....B..    
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 55 00 00 00       	call   80482b4 <call_gmon_start>
 804825f:	e8 ac 00 00 00       	call   8048310 <frame_dummy>
 8048264:	e8 17 02 00 00       	call   8048480 <__do_global_ctors_aux>
 8048269:	c9                   	leave  
 804826a:	c3                   	ret    
Disassembly of section .plt:

0804826c <__libc_start_main@plt-0x10>:
 804826c:	ff 35 cc 95 04 08    	pushl  0x80495cc
 8048272:	ff 25 d0 95 04 08    	jmp    *0x80495d0
 8048278:	00 00                	add    %al,(%eax)
	...

0804827c <__libc_start_main@plt>:
 804827c:	ff 25 d4 95 04 08    	jmp    *0x80495d4
 8048282:	68 00 00 00 00       	push   $0x0
 8048287:	e9 e0 ff ff ff       	jmp    804826c <_init+0x18>
Disassembly of section .text:

08048290 <_start>:
 8048290:	31 ed                	xor    %ebp,%ebp
 8048292:	5e                   	pop    %esi
 8048293:	89 e1                	mov    %esp,%ecx
 8048295:	83 e4 f0             	and    $0xfffffff0,%esp
 8048298:	50                   	push   %eax
 8048299:	54                   	push   %esp
 804829a:	52                   	push   %edx
 804829b:	68 30 84 04 08       	push   $0x8048430
 80482a0:	68 dc 83 04 08       	push   $0x80483dc
 80482a5:	51                   	push   %ecx
 80482a6:	56                   	push   %esi
 80482a7:	68 89 83 04 08       	push   $0x8048389
 80482ac:	e8 cb ff ff ff       	call   804827c <__libc_start_main@plt>
 80482b1:	f4                   	hlt    
 80482b2:	90                   	nop    
 80482b3:	90                   	nop    

080482b4 <call_gmon_start>:
 80482b4:	55                   	push   %ebp
 80482b5:	89 e5                	mov    %esp,%ebp
 80482b7:	53                   	push   %ebx
 80482b8:	e8 00 00 00 00       	call   80482bd <call_gmon_start+0x9>
 80482bd:	5b                   	pop    %ebx
 80482be:	81 c3 0b 13 00 00    	add    $0x130b,%ebx
 80482c4:	52                   	push   %edx
 80482c5:	8b 83 fc ff ff ff    	mov    0xfffffffc(%ebx),%eax
 80482cb:	85 c0                	test   %eax,%eax
 80482cd:	74 02                	je     80482d1 <call_gmon_start+0x1d>
 80482cf:	ff d0                	call   *%eax
 80482d1:	58                   	pop    %eax
 80482d2:	5b                   	pop    %ebx
 80482d3:	c9                   	leave  
 80482d4:	c3                   	ret    
 80482d5:	90                   	nop    
 80482d6:	90                   	nop    
 80482d7:	90                   	nop    
 80482d8:	90                   	nop    
 80482d9:	90                   	nop    
 80482da:	90                   	nop    
 80482db:	90                   	nop    
 80482dc:	90                   	nop    
 80482dd:	90                   	nop    
 80482de:	90                   	nop    
 80482df:	90                   	nop    

080482e0 <__do_global_dtors_aux>:
 80482e0:	55                   	push   %ebp
 80482e1:	89 e5                	mov    %esp,%ebp
 80482e3:	83 ec 08             	sub    $0x8,%esp
 80482e6:	80 3d e4 95 04 08 00 	cmpb   $0x0,0x80495e4
 80482ed:	74 0c                	je     80482fb <__do_global_dtors_aux+0x1b>
 80482ef:	eb 1c                	jmp    804830d <__do_global_dtors_aux+0x2d>
 80482f1:	83 c0 04             	add    $0x4,%eax
 80482f4:	a3 e0 95 04 08       	mov    %eax,0x80495e0
 80482f9:	ff d2                	call   *%edx
 80482fb:	a1 e0 95 04 08       	mov    0x80495e0,%eax
 8048300:	8b 10                	mov    (%eax),%edx
 8048302:	85 d2                	test   %edx,%edx
 8048304:	75 eb                	jne    80482f1 <__do_global_dtors_aux+0x11>
 8048306:	c6 05 e4 95 04 08 01 	movb   $0x1,0x80495e4
 804830d:	c9                   	leave  
 804830e:	c3                   	ret    
 804830f:	90                   	nop    

08048310 <frame_dummy>:
 8048310:	55                   	push   %ebp
 8048311:	89 e5                	mov    %esp,%ebp
 8048313:	83 ec 08             	sub    $0x8,%esp
 8048316:	a1 f8 94 04 08       	mov    0x80494f8,%eax
 804831b:	85 c0                	test   %eax,%eax
 804831d:	74 12                	je     8048331 <frame_dummy+0x21>
 804831f:	b8 00 00 00 00       	mov    $0x0,%eax
 8048324:	85 c0                	test   %eax,%eax
 8048326:	74 09                	je     8048331 <frame_dummy+0x21>
 8048328:	c7 04 24 f8 94 04 08 	movl   $0x80494f8,(%esp)
 804832f:	ff d0                	call   *%eax
 8048331:	c9                   	leave  
 8048332:	c3                   	ret    
 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 10             	sub    $0x10,%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 18             	sub    $0x18,%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 f4             	mov    %eax,0xfffffff4(%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:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
 8048372:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048376:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
 8048379:	89 04 24             	mov    %eax,(%esp)
 804837c:	e8 bf ff ff ff       	call   8048340 <fun2>
 8048381:	89 45 fc             	mov    %eax,0xfffffffc(%ebp)
 8048384:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
 8048387:	c9                   	leave  
 8048388:	c3                   	ret    

08048389 <main>:
 8048389:	55                   	push   %ebp
 804838a:	89 e5                	mov    %esp,%ebp
 804838c:	83 ec 18             	sub    $0x18,%esp
 804838f:	83 e4 f0             	and    $0xfffffff0,%esp
 8048392:	b8 00 00 00 00       	mov    $0x0,%eax
 8048397:	83 c0 0f             	add    $0xf,%eax
 804839a:	83 c0 0f             	add    $0xf,%eax
 804839d:	c1 e8 04             	shr    $0x4,%eax
 80483a0:	c1 e0 04             	shl    $0x4,%eax
 80483a3:	29 c4                	sub    %eax,%esp
 80483a5:	c7 45 f4 c8 00 00 00 	movl   $0xc8,0xfffffff4(%ebp)
 80483ac:	c7 45 f8 64 00 00 00 	movl   $0x64,0xfffffff8(%ebp)
 80483b3:	c7 45 f4 2c 01 00 00 	movl   $0x12c,0xfffffff4(%ebp)
 80483ba:	c7 45 f8 90 01 00 00 	movl   $0x190,0xfffffff8(%ebp)
 80483c1:	8b 45 f8             	mov    0xfffffff8(%ebp),%eax
 80483c4:	89 44 24 04          	mov    %eax,0x4(%esp)
 80483c8:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
 80483cb:	89 04 24             	mov    %eax,(%esp)
 80483ce:	e8 82 ff ff ff       	call   8048355 <fun1>
 80483d3:	89 45 fc             	mov    %eax,0xfffffffc(%ebp)
 80483d6:	8b 45 fc             	mov    0xfffffffc(%ebp),%eax
 80483d9:	c9                   	leave  
 80483da:	c3                   	ret    
 80483db:	90                   	nop    

080483dc <__libc_csu_init>:
 80483dc:	55                   	push   %ebp
 80483dd:	89 e5                	mov    %esp,%ebp
 80483df:	57                   	push   %edi
 80483e0:	56                   	push   %esi
 80483e1:	53                   	push   %ebx
 80483e2:	83 ec 0c             	sub    $0xc,%esp
 80483e5:	e8 00 00 00 00       	call   80483ea <__libc_csu_init+0xe>
 80483ea:	5b                   	pop    %ebx
 80483eb:	81 c3 de 11 00 00    	add    $0x11de,%ebx
 80483f1:	e8 5e fe ff ff       	call   8048254 <_init>
 80483f6:	8d 83 20 ff ff ff    	lea    0xffffff20(%ebx),%eax
 80483fc:	8d 93 20 ff ff ff    	lea    0xffffff20(%ebx),%edx
 8048402:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
 8048405:	29 d0                	sub    %edx,%eax
 8048407:	31 f6                	xor    %esi,%esi
 8048409:	c1 f8 02             	sar    $0x2,%eax
 804840c:	39 c6                	cmp    %eax,%esi
 804840e:	73 16                	jae    8048426 <__libc_csu_init+0x4a>
 8048410:	89 d7                	mov    %edx,%edi
 8048412:	89 f6                	mov    %esi,%esi
 8048414:	ff 14 b2             	call   *(%edx,%esi,4)
 8048417:	8b 4d f0             	mov    0xfffffff0(%ebp),%ecx
 804841a:	29 f9                	sub    %edi,%ecx
 804841c:	46                   	inc    %esi
 804841d:	c1 f9 02             	sar    $0x2,%ecx
 8048420:	39 ce                	cmp    %ecx,%esi
 8048422:	89 fa                	mov    %edi,%edx
 8048424:	72 ee                	jb     8048414 <__libc_csu_init+0x38>
 8048426:	83 c4 0c             	add    $0xc,%esp
 8048429:	5b                   	pop    %ebx
 804842a:	5e                   	pop    %esi
 804842b:	5f                   	pop    %edi
 804842c:	c9                   	leave  
 804842d:	c3                   	ret    
 804842e:	89 f6                	mov    %esi,%esi

08048430 <__libc_csu_fini>:
 8048430:	55                   	push   %ebp
 8048431:	89 e5                	mov    %esp,%ebp
 8048433:	57                   	push   %edi
 8048434:	56                   	push   %esi
 8048435:	53                   	push   %ebx
 8048436:	e8 00 00 00 00       	call   804843b <__libc_csu_fini+0xb>
 804843b:	5b                   	pop    %ebx
 804843c:	81 c3 8d 11 00 00    	add    $0x118d,%ebx
 8048442:	8d 83 20 ff ff ff    	lea    0xffffff20(%ebx),%eax
 8048448:	8d bb 20 ff ff ff    	lea    0xffffff20(%ebx),%edi
 804844e:	29 f8                	sub    %edi,%eax
 8048450:	c1 f8 02             	sar    $0x2,%eax
 8048453:	83 ec 0c             	sub    $0xc,%esp
 8048456:	8d 70 ff             	lea    0xffffffff(%eax),%esi
 8048459:	eb 05                	jmp    8048460 <__libc_csu_fini+0x30>
 804845b:	90                   	nop    
 804845c:	ff 14 b7             	call   *(%edi,%esi,4)
 804845f:	4e                   	dec    %esi
 8048460:	83 fe ff             	cmp    $0xffffffff,%esi
 8048463:	75 f7                	jne    804845c <__libc_csu_fini+0x2c>
 8048465:	e8 56 00 00 00       	call   80484c0 <_fini>
 804846a:	83 c4 0c             	add    $0xc,%esp
 804846d:	5b                   	pop    %ebx
 804846e:	5e                   	pop    %esi
 804846f:	5f                   	pop    %edi
 8048470:	c9                   	leave  
 8048471:	c3                   	ret    
 8048472:	90                   	nop    
 8048473:	90                   	nop    
 8048474:	90                   	nop    
 8048475:	90                   	nop    
 8048476:	90                   	nop    
 8048477:	90                   	nop    
 8048478:	90                   	nop    
 8048479:	90                   	nop    
 804847a:	90                   	nop    
 804847b:	90                   	nop    
 804847c:	90                   	nop    
 804847d:	90                   	nop    
 804847e:	90                   	nop    
 804847f:	90                   	nop    

08048480 <__do_global_ctors_aux>:
 8048480:	55                   	push   %ebp
 8048481:	89 e5                	mov    %esp,%ebp
 8048483:	53                   	push   %ebx
 8048484:	83 ec 04             	sub    $0x4,%esp
 8048487:	a1 e8 94 04 08       	mov    0x80494e8,%eax
 804848c:	83 f8 ff             	cmp    $0xffffffff,%eax
 804848f:	74 1c                	je     80484ad <__do_global_ctors_aux+0x2d>
 8048491:	bb e8 94 04 08       	mov    $0x80494e8,%ebx
 8048496:	8d 76 00             	lea    0x0(%esi),%esi
 8048499:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi
 80484a0:	ff d0                	call   *%eax
 80484a2:	8b 43 fc             	mov    0xfffffffc(%ebx),%eax
 80484a5:	83 eb 04             	sub    $0x4,%ebx
 80484a8:	83 f8 ff             	cmp    $0xffffffff,%eax
 80484ab:	75 f3                	jne    80484a0 <__do_global_ctors_aux+0x20>
 80484ad:	58                   	pop    %eax
 80484ae:	5b                   	pop    %ebx
 80484af:	5d                   	pop    %ebp
 80484b0:	c3                   	ret    
 80484b1:	90                   	nop    
 80484b2:	90                   	nop    
 80484b3:	90                   	nop    
Disassembly of section .my_section:

080484b4 <.my_section>:
 80484b4:	e8 87 fe ff ff       	call   8048340 <fun2>
 80484b9:	e8 82 fe ff ff       	call   8048340 <fun2>
Disassembly of section .fini:

080484c0 <_fini>:
 80484c0:	55                   	push   %ebp
 80484c1:	89 e5                	mov    %esp,%ebp
 80484c3:	53                   	push   %ebx
 80484c4:	e8 00 00 00 00       	call   80484c9 <_fini+0x9>
 80484c9:	5b                   	pop    %ebx
 80484ca:	81 c3 ff 10 00 00    	add    $0x10ff,%ebx
 80484d0:	50                   	push   %eax
 80484d1:	e8 0a fe ff ff       	call   80482e0 <__do_global_dtors_aux>
 80484d6:	59                   	pop    %ecx
 80484d7:	5b                   	pop    %ebx
 80484d8:	c9                   	leave  
 80484d9:	c3                   	ret    

[-- Attachment #4: log2 --]
[-- Type: application/octet-stream, Size: 4406 bytes --]

The section .debug_aranges contains:

  Length:                   36
  Version:                  2
  Offset into .debug_info:  0
  Pointer Size:             4
  Segment Size:             0

    Address  Length
    08048334 10
    080484b4 10
  Length:                   28
  Version:                  2
  Offset into .debug_info:  58
  Pointer Size:             4
  Segment Size:             0

    Address  Length
    08048340 155

Contents of the .debug_pubnames section:

  Length:                              41
  Version:                             2
  Offset into .debug_info section:     88
  Size of area in .debug_info section: 319

    Offset	Name
    92    		fun2
    164   		fun1
    255   		main

The section .debug_info contains:

  Compilation Unit @ 0:
   Length:        84
   Version:       2
   Abbrev Offset: 0
   Pointer Size:  4
 <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
     DW_AT_stmt_list   : 0	
     DW_AT_name        : s2.s	
     DW_AT_comp_dir    : /home/qinwei/GJ283/code/build_linux/debug-gdb	
     DW_AT_producer    : GNU AS 2.15.92.0.2	
     DW_AT_language    : 32769	(MIPS assembler)
  Compilation Unit @ 58:
   Length:        315
   Version:       2
   Abbrev Offset: 16
   Pointer Size:  4
 <0><63>: Abbrev Number: 1 (DW_TAG_compile_unit)
     DW_AT_stmt_list   : 62	
     DW_AT_high_pc     : 0x80483db	
     DW_AT_low_pc      : 0x8048340	
     DW_AT_producer    : GNU C 4.0.2	
     DW_AT_language    : 1	(ANSI C)
     DW_AT_name        : tp_bt1.c	
     DW_AT_comp_dir    : /home/qinwei/GJ283/code/build_linux/debug-gdb	
 <1><b4>: Abbrev Number: 2 (DW_TAG_subprogram)
     DW_AT_sibling     : <f5>	
     DW_AT_external    : 1	
     DW_AT_name        : fun2	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 3	
     DW_AT_prototyped  : 1	
     DW_AT_type        : <f5>	
     DW_AT_low_pc      : 0x8048340	
     DW_AT_high_pc     : 0x8048355	
     DW_AT_frame_base  : 1 byte block: 55 	(DW_OP_reg5)
 <2><d0>: Abbrev Number: 3 (DW_TAG_formal_parameter)
     DW_AT_name        : x	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 2	
     DW_AT_type        : <f5>	
     DW_AT_location    : 2 byte block: 75 8 	(DW_OP_breg5: 8)
 <2><dc>: Abbrev Number: 3 (DW_TAG_formal_parameter)
     DW_AT_name        : y	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 2	
     DW_AT_type        : <f5>	
     DW_AT_location    : 2 byte block: 75 c 	(DW_OP_breg5: 12)
 <2><e8>: Abbrev Number: 4 (DW_TAG_variable)
     DW_AT_name        : z	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 4	
     DW_AT_type        : <f5>	
     DW_AT_location    : 2 byte block: 75 7c 	(DW_OP_breg5: -4)
 <1><f5>: Abbrev Number: 5 (DW_TAG_base_type)
     DW_AT_name        : int	
     DW_AT_byte_size   : 4	
     DW_AT_encoding    : 5	(signed)
 <1><fc>: Abbrev Number: 2 (DW_TAG_subprogram)
     DW_AT_sibling     : <157>	
     DW_AT_external    : 1	
     DW_AT_name        : fun1	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 11	
     DW_AT_prototyped  : 1	
     DW_AT_type        : <f5>	
     DW_AT_low_pc      : 0x8048355	
     DW_AT_high_pc     : 0x8048389	
     DW_AT_frame_base  : 1 byte block: 55 	(DW_OP_reg5)
 <2><118>: Abbrev Number: 3 (DW_TAG_formal_parameter)
     DW_AT_name        : k	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 10	
     DW_AT_type        : <f5>	
     DW_AT_location    : 2 byte block: 75 8 	(DW_OP_breg5: 8)
 <2><124>: Abbrev Number: 3 (DW_TAG_formal_parameter)
     DW_AT_name        : l	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 10	
     DW_AT_type        : <f5>	
     DW_AT_location    : 2 byte block: 75 c 	(DW_OP_breg5: 12)
 <2><130>: Abbrev Number: 4 (DW_TAG_variable)
     DW_AT_name        : m	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 12	
     DW_AT_type        : <f5>	
     DW_AT_location    : 2 byte block: 75 74 	(DW_OP_breg5: -12)
 <2><13c>: Abbrev Number: 4 (DW_TAG_variable)
     DW_AT_name        : n	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 12	
     DW_AT_type        : <f5>	
     DW_AT_location    : 2 byte block: 75 78 	(DW_OP_breg5: -8)
 <2><148>: Abbrev Number: 4 (DW_TAG_variable)
     DW_AT_name        : ret	
     DW_AT_decl_file   : 1	
     DW_AT_decl_line   : 13	
     DW_AT_type        : <f5>	
     DW_AT_location    : 2 byte block: 75 7c 	(DW_OP_breg5: -4)
 <1><157>: Abbrev Number: 6 (DW_TAG_subprogram)
     DW_AT_external    : 1	
     DW_AT_name        : main	
   

[-- Attachment #5: s2.s --]
[-- Type: application/octet-stream, Size: 81 bytes --]

    .section .my_section,"ax"
	call	fun2
	call	fun2
	.text
	call	fun1
	call	fun1

      reply	other threads:[~2007-03-28  2:46 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
2007-03-27 11:16     ` Daniel Jacobowitz
2007-03-28  2:46       ` qinwei [this message]

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=OFE445BFC3.D4ED4379-ON482572AC.000DD950-482572AC.000F2CCB@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