[kgtp] Issue 108 in kgtp: Add a new command addr2line to gdb

  • From: kgtp@xxxxxxxxxxxxxx
  • To: kgtp@xxxxxxxxxxxxx
  • Date: Wed, 01 Feb 2012 14:38:48 +0000

Status: Accepted
Owner: teawa...@xxxxxxxxx
Labels: Type-Defect Priority-Medium gdb

New issue 108 by teawa...@xxxxxxxxx: Add a new command addr2line to gdb
http://code.google.com/p/kgtp/issues/detail?id=108

Translate address to line:
static void
find_address_in_section (bfd *abfd, asection *section,
                         void *data ATTRIBUTE_UNUSED)
{
  bfd_vma vma;
  bfd_size_type size;

  if (found)
    return;

  if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
    return;

  vma = bfd_get_section_vma (abfd, section);
  if (pc < vma)
    return;

  size = bfd_get_section_size (section);
  if (pc >= vma + size)
    return;

  found = bfd_find_nearest_line (abfd, section, syms, pc - vma,
                                 &filename, &functionname, &line);
}


Other related posts: