Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
listing.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define LISTING_LISTING   1
#define LISTING_SYMBOLS   2
#define LISTING_NOFORM   4
#define LISTING_HLL   8
#define LISTING_NODEBUG   16
#define LISTING_NOCOND   32
#define LISTING_MACEXP   64
#define LISTING_DEFAULT   (LISTING_LISTING | LISTING_HLL | LISTING_SYMBOLS)
#define LISTING_NEWLINE()   { if (listing) listing_newline(NULL); }
#define LISTING_EOF()   LISTING_NEWLINE()
#define LISTING_SKIP_COND()   ((listing & LISTING_NOCOND) != 0)

Functions

void listing_eject (int)
void listing_error (const char *message)
void listing_file (const char *name)
void listing_flags (int)
void listing_list (int on)
void listing_newline (char *ps)
void listing_prev_line (void)
void listing_print (char *name)
void listing_psize (int)
void listing_nopage (int)
void listing_source_file (const char *)
void listing_source_line (unsigned int)
void listing_title (int depth)
void listing_warning (const char *message)
void listing_width (unsigned int x)

Variables

int listing_lhs_width
int listing_lhs_width_second
int listing_lhs_cont_lines
int listing_rhs_width

Define Documentation

Definition at line 33 of file listing.h.

#define LISTING_EOF ( )    LISTING_NEWLINE()

Definition at line 40 of file listing.h.

#define LISTING_HLL   8

Definition at line 28 of file listing.h.

#define LISTING_LISTING   1

Definition at line 25 of file listing.h.

#define LISTING_MACEXP   64

Definition at line 31 of file listing.h.

#define LISTING_NEWLINE ( )    { if (listing) listing_newline(NULL); }

Definition at line 36 of file listing.h.

#define LISTING_NOCOND   32

Definition at line 30 of file listing.h.

#define LISTING_NODEBUG   16

Definition at line 29 of file listing.h.

#define LISTING_NOFORM   4

Definition at line 27 of file listing.h.

#define LISTING_SKIP_COND ( )    ((listing & LISTING_NOCOND) != 0)

Definition at line 42 of file listing.h.

#define LISTING_SYMBOLS   2

Definition at line 26 of file listing.h.


Function Documentation

void listing_eject ( int  )
void listing_error ( const char *  message)

Definition at line 242 of file listing.c.

{
  listing_message (_("Error:"), message);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void listing_file ( const char *  name)

Definition at line 1105 of file listing.c.

{
  fn = name;
}

Here is the caller graph for this function:

void listing_flags ( int  )
void listing_list ( int  on)

Definition at line 1131 of file listing.c.

{
  if (listing)
    {
      switch (on)
       {
       case 0:
         if (listing_tail->edict == EDICT_LIST)
           listing_tail->edict = EDICT_NONE;
         else
           listing_tail->edict = EDICT_NOLIST;
         break;
       case 1:
         if (listing_tail->edict == EDICT_NOLIST
             || listing_tail->edict == EDICT_NOLIST_NEXT)
           listing_tail->edict = EDICT_NONE;
         else
           listing_tail->edict = EDICT_LIST;
         break;
       case 2:
         listing_tail->edict = EDICT_NOLIST_NEXT;
         break;
       default:
         abort ();
       }
    }
}

Here is the caller graph for this function:

void listing_newline ( char *  ps)

Definition at line 280 of file listing.c.

{
  char *file;
  unsigned int line;
  static unsigned int last_line = 0xffff;
  static char *last_file = NULL;
  list_info_type *new = NULL;

  if (listing == 0)
    return;

  if (now_seg == absolute_section)
    return;

#ifdef OBJ_ELF
  /* In ELF, anything in a section beginning with .debug or .line is
     considered to be debugging information.  This includes the
     statement which switches us into the debugging section, which we
     can only set after we are already in the debugging section.  */
  if ((listing & LISTING_NODEBUG) != 0
      && listing_tail != NULL
      && ! listing_tail->debugging)
    {
      const char *segname;

      segname = segment_name (now_seg);
      if (strncmp (segname, ".debug", sizeof ".debug" - 1) == 0
         || strncmp (segname, ".line", sizeof ".line" - 1) == 0)
       listing_tail->debugging = 1;
    }
#endif

  as_where (&file, &line);
  if (ps == NULL)
    {
      if (line == last_line
         && !(last_file && file && strcmp (file, last_file)))
       return;

      new = (list_info_type *) xmalloc (sizeof (list_info_type));

      /* Detect if we are reading from stdin by examining the file
        name returned by as_where().

        [FIXME: We rely upon the name in the strcmp below being the
        same as the one used by input_scrub_new_file(), if that is
        not true, then this code will fail].

        If we are reading from stdin, then we need to save each input
        line here (assuming of course that we actually have a line of
        input to read), so that it can be displayed in the listing
        that is produced at the end of the assembly.  */
      if (strcmp (file, _("{standard input}")) == 0
         && input_line_pointer != NULL)
       {
         char *copy;
         int len;
         int seen_quote = 0;

         for (copy = input_line_pointer - 1;
              *copy && (seen_quote
                      || (! is_end_of_line [(unsigned char) *copy]));
              copy++)
           if (*copy == '"' && copy[-1] != '\\')
             seen_quote = ! seen_quote;

         len = (copy - input_line_pointer) + 2;

         copy = xmalloc (len);

         if (copy != NULL)
           {
             char *src = input_line_pointer - 1;
             char *dest = copy;

             while (--len)
              {
                unsigned char c = *src++;

                /* Omit control characters in the listing.  */
                if (!ISCNTRL (c))
                  *dest++ = c;
              }

             *dest = 0;
           }

         new->line_contents = copy;
       }
      else
       new->line_contents = NULL;
    }
  else
    {
      new = xmalloc (sizeof (list_info_type));
      new->line_contents = ps;
    }

  last_line = line;
  last_file = file;

  new_frag ();

  if (listing_tail)
    listing_tail->next = new;
  else
    head = new;

  listing_tail = new;

  new->frag = frag_now;
  new->line = line;
  new->file = file_info (file);
  new->next = (list_info_type *) NULL;
  new->message = (char *) NULL;
  new->edict = EDICT_NONE;
  new->hll_file = (file_info_type *) NULL;
  new->hll_line = 0;
  new->debugging = 0;

  new_frag ();

#ifdef OBJ_ELF
  /* In ELF, anything in a section beginning with .debug or .line is
     considered to be debugging information.  */
  if ((listing & LISTING_NODEBUG) != 0)
    {
      const char *segname;

      segname = segment_name (now_seg);
      if (strncmp (segname, ".debug", sizeof ".debug" - 1) == 0
         || strncmp (segname, ".line", sizeof ".line" - 1) == 0)
       new->debugging = 1;
    }
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void listing_nopage ( int  )
void listing_prev_line ( void  )

Definition at line 424 of file listing.c.

{
  list_info_type *l;
  fragS *f;

  if (head == (list_info_type *) NULL
      || head == listing_tail)
    return;

  new_frag ();

  for (l = head; l->next != listing_tail; l = l->next)
    ;

  for (f = frchain_now->frch_root; f != (fragS *) NULL; f = f->fr_next)
    if (f->line == listing_tail)
      f->line = l;

  listing_tail->frag = frag_now;
  new_frag ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void listing_print ( char *  name)

Definition at line 1060 of file listing.c.

{
  int using_stdout;

  title = "";
  subtitle = "";

  if (name == NULL)
    {
      list_file = stdout;
      using_stdout = 1;
    }
  else
    {
      list_file = fopen (name, FOPEN_WT);
      if (list_file != NULL)
       using_stdout = 0;
      else
       {
         as_warn (_("can't open %s: %s"), name, xstrerror (errno));
         list_file = stdout;
         using_stdout = 1;
       }
    }

  if (listing & LISTING_NOFORM)
    paper_height = 0;

  if (listing & LISTING_LISTING)
    listing_listing (name);

  if (listing & LISTING_SYMBOLS)
    list_symbol_table ();

  if (! using_stdout)
    {
      if (fclose (list_file) == EOF)
       as_warn (_("can't close %s: %s"), name, xstrerror (errno));
    }

  if (last_open_file)
    fclose (last_open_file);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void listing_psize ( int  )

Definition at line 1160 of file listing.c.

{
  if (! width_only)
    {
      paper_height = get_absolute_expression ();

      if (paper_height < 0 || paper_height > 1000)
       {
         paper_height = 0;
         as_warn (_("strange paper height, set to no form"));
       }

      if (*input_line_pointer != ',')
       {
         demand_empty_rest_of_line ();
         return;
       }

      ++input_line_pointer;
    }

  paper_width = get_absolute_expression ();

  demand_empty_rest_of_line ();
}

Here is the call graph for this function:

void listing_source_file ( const char *  )

Definition at line 1256 of file listing.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1245 of file listing.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void listing_title ( int  depth)

Definition at line 1193 of file listing.c.

{
  int quoted;
  char *start;
  char *ttl;
  unsigned int length;

  SKIP_WHITESPACE ();
  if (*input_line_pointer != '\"')
    quoted = 0;
  else
    {
      quoted = 1;
      ++input_line_pointer;
    }

  start = input_line_pointer;

  while (*input_line_pointer)
    {
      if (quoted
         ? *input_line_pointer == '\"'
         : is_end_of_line[(unsigned char) *input_line_pointer])
       {
         if (listing)
           {
             length = input_line_pointer - start;
             ttl = xmalloc (length + 1);
             memcpy (ttl, start, length);
             ttl[length] = 0;
             listing_tail->edict = depth ? EDICT_SBTTL : EDICT_TITLE;
             listing_tail->edict_arg = ttl;
           }
         if (quoted)
           input_line_pointer++;
         demand_empty_rest_of_line ();
         return;
       }
      else if (*input_line_pointer == '\n')
       {
         as_bad (_("new line in title"));
         demand_empty_rest_of_line ();
         return;
       }
      else
       {
         input_line_pointer++;
       }
    }
}

Here is the call graph for this function:

void listing_warning ( const char *  message)

Definition at line 236 of file listing.c.

{
  listing_message (_("Warning:"), message);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void listing_width ( unsigned int  x)

Variable Documentation

Definition at line 181 of file listing.c.

Definition at line 179 of file listing.c.

Definition at line 180 of file listing.c.

Definition at line 182 of file listing.c.