* dwarf2dbg.c (*): Convert to K&R + prototypes.
authorRichard Henderson <rth@redhat.com>
Sat, 5 Jun 1999 18:19:09 +0000 (18:19 +0000)
committerRichard Henderson <rth@redhat.com>
Sat, 5 Jun 1999 18:19:09 +0000 (18:19 +0000)
        (dwarf2_gen_line_info): Kill unused variables.
        (dwarf2_finish): Likewise.
        (dwarf2_where): Likewise.
        (dwarf2_directive_file): If we've only got a string,
        hand off to s_app_file.
        * ecoff.c: Move the include of ecoff.h.
        * symbols.h (S_IS_FUNCTION): Prototype.
        * read.c (LEX_HASH): Supply a default.
        (lex_type): Use it.
        (s_globl): Update `c' after skipping whitespace.
        * read.h (LEX_END_NAME, is_name_ender): New.
        * expr.c (get_symbol_end): Respect it.

gas/ChangeLog
gas/dwarf2dbg.c
gas/ecoff.c
gas/expr.c
gas/read.c
gas/read.h
gas/symbols.h

index 684f4d9bf4c4a77303c36033be2a155788057e25..7b0dae0f473900452d7ac2560b62f5bb7cbe2ffb 100644 (file)
@@ -1,3 +1,20 @@
+1999-06-05  Richard Henderson  <rth@cygnus.com>
+
+       * dwarf2dbg.c (*): Convert to K&R + prototypes.
+       (dwarf2_gen_line_info): Kill unused variables.
+       (dwarf2_finish): Likewise.
+       (dwarf2_where): Likewise.
+       (dwarf2_directive_file): If we've only got a string,
+       hand off to s_app_file.
+       * ecoff.c: Move the include of ecoff.h.
+       * symbols.h (S_IS_FUNCTION): Prototype.
+
+       * read.c (LEX_HASH): Supply a default.
+       (lex_type): Use it.
+       (s_globl): Update `c' after skipping whitespace.
+       * read.h (LEX_END_NAME, is_name_ender): New.
+       * expr.c (get_symbol_end): Respect it.
+
 1999-06-04  Mark Klein <mklein@dis.com>
 
        * config/tc-hppa.c (md_begin): Convert local symbol dummy_symbol
index 3c223e880fa74a2cdf06b75eff2b3859f3d4b0ee..c23b7f677ee010da61261845cccb1cc056e09352 100644 (file)
@@ -146,12 +146,27 @@ ls =
     },
   };
 
+
+/* Function prototypes: */
+static void out_uleb128 PARAMS ((bfd_vma));
+static void out_sleb128 PARAMS ((bfd_signed_vma));
+static void gen_addr_line PARAMS ((int, bfd_vma));
+static void reset_state_machine PARAMS ((void));
+static void out_set_addr PARAMS ((bfd_vma));
+static void out_end_sequence PARAMS ((void));
+static int get_filenum PARAMS ((int, char *));
+static void gen_dir_list PARAMS ((void));
+static void gen_file_list PARAMS ((void));
+static void print_stats PARAMS ((unsigned long));
+
+
 #define out_byte(byte) FRAG_APPEND_1_CHAR(byte)
 #define out_opcode(opc)        (out_byte ((opc)), ++ls.opcode_hist[(opc) & 0xff])
 
 /* Output an unsigned "little-endian base 128" number.  */
 static void
-out_uleb128 (bfd_vma value)
+out_uleb128 (value)
+     bfd_vma value;
 {
   unsigned char byte, more = 0x80;
 
@@ -168,7 +183,8 @@ out_uleb128 (bfd_vma value)
 
 /* Output a signed "little-endian base 128" number.  */
 static void
-out_sleb128 (bfd_signed_vma value)
+out_sleb128 (value)
+     bfd_signed_vma value;
 {
   unsigned char byte, more = 0x80;
 
@@ -188,7 +204,9 @@ out_sleb128 (bfd_signed_vma value)
    Note that the line skip is signed, whereas the address skip is
    unsigned.  */
 static void
-gen_addr_line (int line_delta, bfd_vma addr_delta)
+gen_addr_line (line_delta, addr_delta)
+     int line_delta;
+     bfd_vma addr_delta;
 {
   unsigned int tmp, opcode;
 
@@ -231,7 +249,7 @@ gen_addr_line (int line_delta, bfd_vma addr_delta)
 }
 
 static void
-reset_state_machine (void)
+reset_state_machine ()
 {
   static const struct dwarf2_sm initial_state = { INITIAL_STATE };
 
@@ -240,7 +258,8 @@ reset_state_machine (void)
 
 /* Set an absolute address (may results in a relocation entry): */
 static void
-out_set_addr (bfd_vma addr)
+out_set_addr (addr)
+     bfd_vma addr;
 {
   subsegT saved_subseg;
   segT saved_seg;
@@ -268,7 +287,7 @@ out_set_addr (bfd_vma addr)
 /* Emit DW_LNS_end_sequence and reset state machine.  Does not
    preserve the current segment/sub-segment!  */
 static void
-out_end_sequence (void)
+out_end_sequence ()
 {
   bfd_vma addr, delta;
 
@@ -308,7 +327,9 @@ out_end_sequence (void)
    precedence.  If the filename cannot be found, it is added to the
    filetable the filenumber for the new entry is returned.  */
 static int
-get_filenum (int filenum, char *file)
+get_filenum (filenum, file)
+     int filenum;
+     char *file;
 {
   int i, last = filenum - 1;
   char char0 = file[0];
@@ -344,16 +365,17 @@ get_filenum (int filenum, char *file)
 }
 
 void
-dwarf2_gen_line_info (bfd_vma addr, struct dwarf2_line_info *l)
+dwarf2_gen_line_info (addr, l)
+     bfd_vma addr;
+     struct dwarf2_line_info *l;
 {
   unsigned int filenum = l->filenum;
   unsigned int any_output = 0;
   subsegT saved_subseg;
   segT saved_seg;
-  char *frag;
 
   if (flag_debug)
-    fprintf (stderr, "line: addr %llx file `%s' line %u col %u flags %lx\n",
+    fprintf (stderr, "line: addr %llx file `%s' line %u col %u flags %x\n",
             (long long) addr, l->filename, l->line, l->column, l->flags);
 
   if (filenum > 0 && !l->filename)
@@ -452,7 +474,7 @@ dwarf2_gen_line_info (bfd_vma addr, struct dwarf2_line_info *l)
 }
 
 static void
-gen_dir_list (void)
+gen_dir_list ()
 {
   char *str, *slash, *dir_list, *dp, *cp;
   int i, j, num_dirs;
@@ -492,7 +514,7 @@ gen_dir_list (void)
 }
 
 static void
-gen_file_list (void)
+gen_file_list ()
 {
   size_t size;
   char *cp;
@@ -511,8 +533,9 @@ gen_file_list (void)
   out_byte (0);                /* terminate filename list */
 }
 
-void
-print_stats (unsigned long total_size)
+static void
+print_stats (total_size)
+     unsigned long total_size;
 {
   static const char *opc_name[] =
     {
@@ -554,10 +577,10 @@ print_stats (unsigned long total_size)
 }
 
 void
-dwarf2_finish (void)
+dwarf2_finish ()
 {
-  bfd_vma addr, body_size, total_size, prolog_size;
-  subsegT saved_subseg, line_prolog;
+  bfd_vma body_size, total_size, prolog_size;
+  subsegT saved_subseg;
   segT saved_seg;
   char *cp;
 
@@ -614,10 +637,19 @@ dwarf2_finish (void)
 }
 
 void
-dwarf2_directive_file (int dummy)
+dwarf2_directive_file (dummy)
+     int dummy;
 {
   int len;
 
+  /* Continue to accept a bare string and pass it off.  */
+  SKIP_WHITESPACE ();
+  if (*input_line_pointer == '"')
+    {
+      s_app_file (0);
+      return;
+    }
+
   ls.any_dwarf2_directives = 1;
 
   if (debug_type == DEBUG_NONE)
@@ -632,7 +664,8 @@ dwarf2_directive_file (int dummy)
 }
 
 void
-dwarf2_directive_loc (int dummy)
+dwarf2_directive_loc (dummy)
+     int dummy;
 {
   ls.any_dwarf2_directives = 1;
 
@@ -652,14 +685,13 @@ dwarf2_directive_loc (int dummy)
 }
 
 void
-dwarf2_where (struct dwarf2_line_info *line)
+dwarf2_where (line)
+     struct dwarf2_line_info *line;
 {
   if (ls.any_dwarf2_directives)
     *line = ls.current;
   else
     {
-      char *filename;
-
       as_where (&line->filename, &line->line);
       line->filenum = 0;
       line->column = 0;
index 310d6672efe92199ac079ed1c1dba1584eab84fb..436c8c4af56a60a5c2c3b02c2adec2bb96f5a10e 100644 (file)
    ECOFF debugging information (e.g., MIPS ECOFF, MIPS ELF, Alpha
    ECOFF).  */
 
+#include "ecoff.h"
+
 #ifdef ECOFF_DEBUGGING
 
 #include "coff/internal.h"
 #include "coff/symconst.h"
-#include "ecoff.h"
 #include "aout/stab_gnu.h"
 
 #include <ctype.h>
index 6e74bfa1daa8e64a4a9b1a50b44a70c3b3fd48e3..c50e2c2f33d444608a8c5b7f94eb1019b625ca65 100644 (file)
@@ -1863,9 +1863,13 @@ get_symbol_end ()
   /* We accept \001 in a name in case this is being called with a
      constructed string.  */
   if (is_name_beginner (c = *input_line_pointer++) || c == '\001')
-    while (is_part_of_name (c = *input_line_pointer++)
-          || c == '\001')
-      ;
+    {
+      while (is_part_of_name (c = *input_line_pointer++)
+            || c == '\001')
+       ;
+      if (is_name_ender (c))
+       c = *input_line_pointer++;
+    }
   *--input_line_pointer = 0;
   return (c);
 }
index ecf2c57ad3666243ca9a67f2f12e9865de5cd5fb..6d34511b27d0436da6a222c9fd40c8179d9bbc64 100644 (file)
@@ -89,6 +89,10 @@ die horribly;
 #define LEX_QM 0
 #endif
 
+#ifndef LEX_HASH
+#define LEX_HASH 0
+#endif
+
 #ifndef LEX_DOLLAR
 /* The a29k assembler does not permits labels to start with $.  */
 #define LEX_DOLLAR 3
@@ -104,7 +108,7 @@ char lex_type[256] =
 {
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      /* @ABCDEFGHIJKLMNO */
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      /* PQRSTUVWXYZ[\]^_ */
-  0, 0, 0, 0, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
+  0, 0, 0, LEX_HASH, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, LEX_QM, /* 0123456789:;<=>? */
   LEX_AT, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* @ABCDEFGHIJKLMNO */
   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, LEX_BR, 0, LEX_BR, 0, 3, /* PQRSTUVWXYZ[\]^_ */
@@ -1789,9 +1793,11 @@ s_globl (ignore)
       name = input_line_pointer;
       c = get_symbol_end ();
       symbolP = symbol_find_or_make (name);
+      S_SET_EXTERNAL (symbolP);
+
       *input_line_pointer = c;
       SKIP_WHITESPACE ();
-      S_SET_EXTERNAL (symbolP);
+      c = *input_line_pointer;
       if (c == ',')
        {
          input_line_pointer++;
index 61e20172be80cffd49aa55effd83be4a61281199..ae3b103686ba8eb91f00bc7756cba3d15b79db32 100644 (file)
@@ -35,11 +35,14 @@ extern char *input_line_pointer;/* -> char we are parsing now. */
 
 #define        LEX_NAME        (1)     /* may continue a name */
 #define LEX_BEGIN_NAME (2)     /* may begin a name */
+#define LEX_END_NAME   (4)     /* ends a name */
 
 #define is_name_beginner(c) \
   ( lex_type[(unsigned char) (c)] & LEX_BEGIN_NAME )
 #define is_part_of_name(c) \
   ( lex_type[(unsigned char) (c)] & LEX_NAME       )
+#define is_name_ender(c) \
+  ( lex_type[(unsigned char) (c)] & LEX_END_NAME   )
 
 #ifndef is_a_char
 #define CHAR_MASK      (0xff)
index bd7604e09778907413d166f3b2c46c538baed967..f3b73af9660249b86a12feeb3fcc1362161a9d63 100644 (file)
@@ -84,6 +84,7 @@ extern valueT S_GET_VALUE PARAMS ((symbolS *));
 extern void S_SET_VALUE PARAMS ((symbolS *, valueT));
 
 #ifdef BFD_ASSEMBLER
+extern int S_IS_FUNCTION PARAMS ((symbolS *));
 extern int S_IS_EXTERNAL PARAMS ((symbolS *));
 extern int S_IS_WEAK PARAMS ((symbolS *));
 extern int S_IS_COMMON PARAMS ((symbolS *));
This page took 0.034516 seconds and 4 git commands to generate.