This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to avoid "but contains no code." in command "info line"?


> 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: tp_bt1.c
Description: Binary data

Attachment: log1
Description: Binary data

Attachment: log2
Description: Binary data

Attachment: s2.s
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]