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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [debug.c] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
/* This file is debug.c
/* This file is debug.c
   Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2006, 2007
   Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2006, 2007
   Free Software Foundation, Inc.
   Free Software Foundation, Inc.
 
 
   This file is part of GAS, the GNU Assembler.
   This file is part of GAS, the GNU Assembler.
 
 
   GAS is free software; you can redistribute it and/or modify
   GAS is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   the Free Software Foundation; either version 3, or (at your option)
   any later version.
   any later version.
 
 
   GAS is distributed in the hope that it will be useful,
   GAS is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with GAS; see the file COPYING.  If not, write to
   along with GAS; see the file COPYING.  If not, write to
   the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
   the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 
/* Routines for debug use only.  */
/* Routines for debug use only.  */
 
 
#include "as.h"
#include "as.h"
#include "subsegs.h"
#include "subsegs.h"
 
 
dmp_frags ()
dmp_frags ()
{
{
  asection *s;
  asection *s;
  frchainS *chp;
  frchainS *chp;
  char *p;
  char *p;
 
 
  for (s = stdoutput->sections; s; s = s->next)
  for (s = stdoutput->sections; s; s = s->next)
    for (chp = seg_info (s)->frchainP; chp; chp = chp->frch_next)
    for (chp = seg_info (s)->frchainP; chp; chp = chp->frch_next)
      {
      {
        switch (s)
        switch (s)
          {
          {
          case SEG_DATA:
          case SEG_DATA:
            p = "Data";
            p = "Data";
            break;
            break;
          case SEG_TEXT:
          case SEG_TEXT:
            p = "Text";
            p = "Text";
            break;
            break;
          default:
          default:
            p = "???";
            p = "???";
            break;
            break;
          }
          }
        printf ("\nSEGMENT %s %d\n", p, chp->frch_subseg);
        printf ("\nSEGMENT %s %d\n", p, chp->frch_subseg);
        dmp_frag (chp->frch_root, "\t");
        dmp_frag (chp->frch_root, "\t");
      }
      }
}
}
 
 
dmp_frag (fp, indent)
dmp_frag (fp, indent)
     struct frag *fp;
     struct frag *fp;
     char *indent;
     char *indent;
{
{
  for (; fp; fp = fp->fr_next)
  for (; fp; fp = fp->fr_next)
    {
    {
      printf ("%sFRAGMENT @ 0x%x\n", indent, fp);
      printf ("%sFRAGMENT @ 0x%x\n", indent, fp);
      switch (fp->fr_type)
      switch (fp->fr_type)
        {
        {
        case rs_align:
        case rs_align:
          printf ("%srs_align(%d)\n", indent, fp->fr_offset);
          printf ("%srs_align(%d)\n", indent, fp->fr_offset);
          break;
          break;
        case rs_fill:
        case rs_fill:
          printf ("%srs_fill(%d)\n", indent, fp->fr_offset);
          printf ("%srs_fill(%d)\n", indent, fp->fr_offset);
          printf ("%s", indent);
          printf ("%s", indent);
          var_chars (fp, fp->fr_var + fp->fr_fix);
          var_chars (fp, fp->fr_var + fp->fr_fix);
          printf ("%s\t repeated %d times,", indent, fp->fr_offset);
          printf ("%s\t repeated %d times,", indent, fp->fr_offset);
          printf (" fixed length if # chars == 0)\n");
          printf (" fixed length if # chars == 0)\n");
          break;
          break;
        case rs_org:
        case rs_org:
          printf ("%srs_org(%d+sym @0x%x)\n", indent,
          printf ("%srs_org(%d+sym @0x%x)\n", indent,
                  fp->fr_offset, fp->fr_symbol);
                  fp->fr_offset, fp->fr_symbol);
          printf ("%sfill with ", indent);
          printf ("%sfill with ", indent);
          var_chars (fp, 1);
          var_chars (fp, 1);
          printf ("\n");
          printf ("\n");
          break;
          break;
        case rs_machine_dependent:
        case rs_machine_dependent:
          printf ("%smachine_dep\n", indent);
          printf ("%smachine_dep\n", indent);
          break;
          break;
        default:
        default:
          printf ("%sunknown type\n", indent);
          printf ("%sunknown type\n", indent);
          break;
          break;
        }
        }
      printf ("%saddr=%d(0x%x)\n", indent, fp->fr_address, fp->fr_address);
      printf ("%saddr=%d(0x%x)\n", indent, fp->fr_address, fp->fr_address);
      printf ("%sfr_fix=%d\n", indent, fp->fr_fix);
      printf ("%sfr_fix=%d\n", indent, fp->fr_fix);
      printf ("%sfr_var=%d\n", indent, fp->fr_var);
      printf ("%sfr_var=%d\n", indent, fp->fr_var);
      printf ("%sfr_offset=%d\n", indent, fp->fr_offset);
      printf ("%sfr_offset=%d\n", indent, fp->fr_offset);
      printf ("%schars @ 0x%x\n", indent, fp->fr_literal);
      printf ("%schars @ 0x%x\n", indent, fp->fr_literal);
      printf ("\n");
      printf ("\n");
    }
    }
}
}
 
 
var_chars (fp, n)
var_chars (fp, n)
     struct frag *fp;
     struct frag *fp;
     int n;
     int n;
{
{
  unsigned char *p;
  unsigned char *p;
 
 
  for (p = (unsigned char *) fp->fr_literal; n; n--, p++)
  for (p = (unsigned char *) fp->fr_literal; n; n--, p++)
    {
    {
      printf ("%02x ", *p);
      printf ("%02x ", *p);
    }
    }
}
}
 
 
/* end of debug.c */
/* end of debug.c */
 
 

powered by: WebSVN 2.1.0

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