OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [bfd/] [dwarf1.c] - Diff between revs 157 and 225

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 157 Rev 225
Line 1... Line 1...
/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
   Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007
   Copyright 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009, 2010
   Free Software Foundation, Inc.
   Free Software Foundation, Inc.
 
 
   Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
   Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
 
 
   This file is part of BFD.
   This file is part of BFD.
Line 141... Line 141...
static struct dwarf1_unit*
static struct dwarf1_unit*
alloc_dwarf1_unit (struct dwarf1_debug* stash)
alloc_dwarf1_unit (struct dwarf1_debug* stash)
{
{
  bfd_size_type amt = sizeof (struct dwarf1_unit);
  bfd_size_type amt = sizeof (struct dwarf1_unit);
 
 
  struct dwarf1_unit* x = bfd_zalloc (stash->abfd, amt);
  struct dwarf1_unit* x = (struct dwarf1_unit *) bfd_zalloc (stash->abfd, amt);
  if (x)
  if (x)
    {
    {
      x->prev = stash->lastUnit;
      x->prev = stash->lastUnit;
      stash->lastUnit = x;
      stash->lastUnit = x;
    }
    }
Line 159... Line 159...
static struct dwarf1_func *
static struct dwarf1_func *
alloc_dwarf1_func (struct dwarf1_debug* stash, struct dwarf1_unit* aUnit)
alloc_dwarf1_func (struct dwarf1_debug* stash, struct dwarf1_unit* aUnit)
{
{
  bfd_size_type amt = sizeof (struct dwarf1_func);
  bfd_size_type amt = sizeof (struct dwarf1_func);
 
 
  struct dwarf1_func* x = bfd_zalloc (stash->abfd, amt);
  struct dwarf1_func* x = (struct dwarf1_func *) bfd_zalloc (stash->abfd, amt);
  if (x)
  if (x)
    {
    {
      x->prev = aUnit->func_list;
      x->prev = aUnit->func_list;
      aUnit->func_list = x;
      aUnit->func_list = x;
    }
    }
Line 250... Line 250...
          xptr += 4 + bfd_get_32 (abfd, (bfd_byte *) xptr);
          xptr += 4 + bfd_get_32 (abfd, (bfd_byte *) xptr);
          break;
          break;
        case FORM_STRING:
        case FORM_STRING:
          if (attr == AT_name)
          if (attr == AT_name)
            aDieInfo->name = (char *)xptr;
            aDieInfo->name = (char *)xptr;
          xptr += strlen (aDieInfo->name) + 1;
          xptr += strlen ((char *) xptr) + 1;
          break;
          break;
        }
        }
    }
    }
 
 
  return TRUE;
  return TRUE;
Line 310... Line 310...
         10 = 4 (line number) + 2 (pos in line) + 4 (address in line).  */
         10 = 4 (line number) + 2 (pos in line) + 4 (address in line).  */
      aUnit->line_count = (tblend - xptr) / 10;
      aUnit->line_count = (tblend - xptr) / 10;
 
 
      /* Allocate an array for the entries.  */
      /* Allocate an array for the entries.  */
      amt = sizeof (struct linenumber) * aUnit->line_count;
      amt = sizeof (struct linenumber) * aUnit->line_count;
      aUnit->linenumber_table = bfd_alloc (stash->abfd, amt);
      aUnit->linenumber_table = (struct linenumber *) bfd_alloc (stash->abfd,
 
                                                                 amt);
      if (!aUnit->linenumber_table)
      if (!aUnit->linenumber_table)
        return FALSE;
        return FALSE;
 
 
      for (eachLine = 0; eachLine < aUnit->line_count; eachLine++)
      for (eachLine = 0; eachLine < aUnit->line_count; eachLine++)
        {
        {
Line 471... Line 472...
    {
    {
      asection *msec;
      asection *msec;
      bfd_size_type size = sizeof (struct dwarf1_debug);
      bfd_size_type size = sizeof (struct dwarf1_debug);
 
 
      stash = elf_tdata (abfd)->dwarf1_find_line_info
      stash = elf_tdata (abfd)->dwarf1_find_line_info
        = bfd_zalloc (abfd, size);
        = (struct dwarf1_debug *) bfd_zalloc (abfd, size);
 
 
      if (! stash)
      if (! stash)
        return FALSE;
        return FALSE;
 
 
      msec = bfd_get_section_by_name (abfd, ".debug");
      msec = bfd_get_section_by_name (abfd, ".debug");

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.