Bug 149126 - Gdb can't debug variables in inlined function
Gdb can't debug variables in inlined function
Status: CLOSED DUPLICATE of bug 149125
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alexandre Oliva
Jay Turner
Depends On:
  Show dependency treegraph
Reported: 2005-02-18 18:24 EST by H.J. Lu
Modified: 2015-01-07 19:09 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-01 21:04:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description H.J. Lu 2005-02-18 18:24:05 EST
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-01 21:04:56 EST
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.