Bug 149126 - Gdb can't debug variables in inlined function
Summary: Gdb can't debug variables in inlined function
Status: CLOSED DUPLICATE of bug 149125
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Alexandre Oliva
QA Contact: Jay Turner
Depends On:
TreeView+ depends on / blocked
Reported: 2005-02-18 23:24 UTC by H.J. Lu
Modified: 2015-01-08 00:09 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-01-02 02:04:56 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description H.J. Lu 2005-02-18 23:24:05 UTC
When I tried to debug linker from the default binutils build, I

Breakpoint 3, _bfd_elf_compute_section_file_positions (abfd=0x80fb618,
    at /export/gnu/src/binutils-shr/binutils/bfd/elf.c:3428
3428      for (s = abfd->sections; s != NULL; s = s->next)
(gdb) p sections
No symbol "sections" in current context.
(gdb) p count
No symbol "count" in current context.

Line 3428 is at inlined map_sections_to_segments:
static bfd_boolean
map_sections_to_segments (bfd *abfd)
  asection **sections = NULL;
  asection *s;
  unsigned int i;
  unsigned int count;
  struct elf_segment_map *mfirst;
  struct elf_segment_map **pm;
  struct elf_segment_map *m;
  asection *last_hdr;
  bfd_vma last_size;
  unsigned int phdr_index;
  bfd_vma maxpagesize;
  asection **hdrpp;
  bfd_boolean phdr_in_segment = TRUE;
  bfd_boolean writable;
  int tls_count = 0;
  int sharable_count = 0;
  asection *first_tls = NULL;
  asection *first_sharable = NULL;
  asection *dynsec, *eh_frame_hdr;
  bfd_size_type amt;

None of those local variables are visible to gdb although there are

 <1><a7e8>: Abbrev Number: 75 (DW_TAG_subprogram)
     DW_AT_sibling     : <a97e>
     DW_AT_name        : (indirect string, offset: 0x6801):
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 3405
     DW_AT_prototyped  : 1
     DW_AT_type        : <942>
     DW_AT_inline      : 1      (inlined)
 <2><a7fa>: Abbrev Number: 76 (DW_TAG_formal_parameter)
     DW_AT_name        : (indirect string, offset: 0x235f): abfd
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 3404
     DW_AT_type        : <b45>
 <2><a806>: Abbrev Number: 67 (DW_TAG_variable)
     DW_AT_name        : (indirect string, offset: 0x8f3e): sections
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 3406
     DW_AT_type        : <6c60>

Comment 1 Jan Kratochvil 2007-01-02 02:04:56 UTC
As failed to retrieve the line-matching version of `bfd/elf.c' from CVS I see
this bug as DUPLICATED.  Proper Bug 149125 implementation should resolve it.

*** This bug has been marked as a duplicate of 149125 ***

Note You need to log in before you can comment on or make changes to this bug.