* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 86f6b78d28bb86df170d9d9259c4843a53c3197a..c8c311dbfb7aa0f38a5f2a845aa1d6030a6eff26 100644 (file)
@@ -37,32 +37,20 @@ struct general_symbol_info
 
   char *name;
 
-  /* Constant value, or address if static, or register number,
-     or offset in arguments, or offset in stack frame.  All of
-     these are in host byte order (though what they point to might
-     be in target byte order, e.g. LOC_CONST_BYTES).
-
-     Note that the address of a function is SYMBOL_VALUE_ADDRESS (pst)
-     in a partial symbol table, but BLOCK_START (SYMBOL_BLOCK_VALUE (st))
-     in a symbol table.  */
+  /* Value of the symbol.  Which member of this union to use, and what
+     it means, depends on what kind of symbol this is and its
+     SYMBOL_CLASS.  See comments there for more details.  All of these
+     are in host byte order (though what they point to might be in
+     target byte order, e.g. LOC_CONST_BYTES).  */
 
   union
     {
-      /* for LOC_CONST, LOC_REGISTER, LOC_ARG, LOC_REF_ARG, LOC_REGPARM,
-        LOC_LOCAL */
-
       long value;
 
-      /* for LOC_BLOCK */
-
       struct block *block;
 
-      /* for LOC_CONST_BYTES */
-
       char *bytes;
 
-      /* for LOC_STATIC, LOC_LABEL */
-
       CORE_ADDR address;
 
       /* for opaque typedef struct chain */
@@ -91,13 +79,11 @@ struct general_symbol_info
            {
              char *demangled_name;
            } cplus_specific;
-         /* start-sanitize-chill */
          /* For Chill */
          struct chill_specific
            {
              char *demangled_name;
            } chill_specific;
-         /* end-sanitize-chill */
        } lang_u;
     } lang_specific;
 
@@ -134,12 +120,10 @@ extern int demangle;      /* We reference it, so go ahead and declare it. */
       {                                                                        \
        SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL;                    \
       }                                                                        \
-    /* start-sanitize-chill */                                         \
     else if (SYMBOL_LANGUAGE (symbol) == language_chill)               \
       {                                                                        \
        SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL;                    \
       }                                                                        \
-    /* end-sanitize-chill */                                           \
     else                                                               \
       {                                                                        \
        memset (&(symbol)->ginfo.lang_specific.lang_u, 0,               \
@@ -176,7 +160,6 @@ extern int demangle;        /* We reference it, so go ahead and declare it. */
            SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL;                \
          }                                                             \
       }                                                                        \
-    /* start-sanitize-chill */                                         \
     if (demangled == NULL                                              \
        && (SYMBOL_LANGUAGE (symbol) == language_chill                  \
            || SYMBOL_LANGUAGE (symbol) == language_auto))              \
@@ -195,7 +178,6 @@ extern int demangle;        /* We reference it, so go ahead and declare it. */
            SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL;                \
          }                                                             \
       }                                                                        \
-    /* end-sanitize-chill */                                           \
     if (SYMBOL_LANGUAGE (symbol) == language_auto)                     \
       {                                                                        \
        SYMBOL_LANGUAGE (symbol) = language_unknown;                    \
@@ -205,20 +187,6 @@ extern int demangle;       /* We reference it, so go ahead and declare it. */
 /* Macro that returns the demangled name for a symbol based on the language
    for that symbol.  If no demangled name exists, returns NULL. */
 
-#define SYMBOL_DEMANGLED_NAME(symbol)                                  \
-  (SYMBOL_LANGUAGE (symbol) == language_cplus                          \
-   ? SYMBOL_CPLUS_DEMANGLED_NAME (symbol)                              \
-   : NULL)
-
-/* start-sanitize-chill */
-
-#define SYMBOL_CHILL_DEMANGLED_NAME(symbol)                            \
-  (symbol)->ginfo.lang_specific.lang_u.chill_specific.demangled_name
-
-/* Redefine SYMBOL_DEMANGLED_NAME.  This is simplier than trying to
-   devise a macro for which part of it can be cleanly sanitized away. */
-
-#undef SYMBOL_DEMANGLED_NAME
 #define SYMBOL_DEMANGLED_NAME(symbol)                                  \
   (SYMBOL_LANGUAGE (symbol) == language_cplus                          \
    ? SYMBOL_CPLUS_DEMANGLED_NAME (symbol)                              \
@@ -226,7 +194,8 @@ extern int demangle;        /* We reference it, so go ahead and declare it. */
       ? SYMBOL_CHILL_DEMANGLED_NAME (symbol)                           \
       : NULL))
 
-/* end-sanitize-chill */
+#define SYMBOL_CHILL_DEMANGLED_NAME(symbol)                            \
+  (symbol)->ginfo.lang_specific.lang_u.chill_specific.demangled_name
 
 /* Macro that returns the "natural source name" of a symbol.  In C++ this is
    the "demangled" form of the name if demangle is on and the "mangled" form
@@ -286,7 +255,10 @@ extern int demangle;       /* We reference it, so go ahead and declare it. */
 struct minimal_symbol
 {
 
-  /* The general symbol info required for all types of symbols. */
+  /* The general symbol info required for all types of symbols.
+
+     The SYMBOL_VALUE_ADDRESS contains the address that this symbol
+     corresponds to.  */
 
   struct general_symbol_info ginfo;
 
@@ -468,33 +440,41 @@ enum address_class
 
   LOC_STATIC,
 
-  /* Value is in register */
+  /* Value is in register.  SYMBOL_VALUE is the register number.  */
 
   LOC_REGISTER,
 
-  /* Value is at spec'd offset in arglist */
+  /* It's an argument; the value is at SYMBOL_VALUE offset in arglist.  */
 
   LOC_ARG,
 
-  /* Value address is at spec'd offset in arglist. */
+  /* Value address is at SYMBOL_VALUE offset in arglist.  */
 
   LOC_REF_ARG,
 
-  /* Value is in specified register.  Just like LOC_REGISTER except this is
-     an argument.  Probably the cleaner way to handle this would be to
-     separate address_class (which would include separate ARG and LOCAL
-     to deal with FRAME_ARGS_ADDRESS versus FRAME_LOCALS_ADDRESS), and
-     an is_argument flag.
+  /* Value is in register number SYMBOL_VALUE.  Just like LOC_REGISTER
+     except this is an argument.  Probably the cleaner way to handle
+     this would be to separate address_class (which would include
+     separate ARG and LOCAL to deal with FRAME_ARGS_ADDRESS versus
+     FRAME_LOCALS_ADDRESS), and an is_argument flag.
 
      For some symbol formats (stabs, for some compilers at least),
-     gdb generates a LOC_ARG and a LOC_REGISTER rather than a LOC_REGPARM.
-     This is because that's what the compiler does, but perhaps it would
-     be better if the symbol-reading code detected this (is it possible?)
-     and generated a LOC_REGPARM.  */
+     the compiler generates two symbols, an argument and a register.
+     In some cases we combine them to a single LOC_REGPARM in symbol
+     reading, but currently not for all cases (e.g. it's passed on the
+     stack and then loaded into a register).  */
 
   LOC_REGPARM,
 
-  /* Value is at spec'd offset in stack frame */
+  /* Value is in specified register.  Just like LOC_REGPARM except the
+     register holds the address of the argument instead of the argument
+     itself. This is currently used for the passing of structs and unions
+     on sparc and hppa.  It is also used for call by reference where the
+     address is in a register, at least by mipsread.c.  */
+
+  LOC_REGPARM_ADDR,
+
+  /* Value is a local variable at SYMBOL_VALUE offset in stack frame.  */
 
   LOC_LOCAL,
 
@@ -507,8 +487,9 @@ enum address_class
 
   LOC_LABEL,
 
-  /* Value is address SYMBOL_VALUE_BLOCK of a `struct block'.  Function names
-     have this class. */
+  /* In a symbol table, value is SYMBOL_BLOCK_VALUE of a `struct block'.
+     In a partial symbol table, SYMBOL_VALUE_ADDRESS is the start address
+     of the block.  Function names have this class. */
 
   LOC_BLOCK,
 
@@ -517,16 +498,16 @@ enum address_class
 
   LOC_CONST_BYTES,
 
-  /* Value is arg at spec'd offset in stack frame. Differs from LOC_LOCAL in
-     that symbol is an argument; differs from LOC_ARG in that we find it
-     in the frame (FRAME_LOCALS_ADDRESS), not in the arglist
-     (FRAME_ARGS_ADDRESS).  Added for i960, which passes args in regs then
-     copies to frame.  */
+  /* Value is arg at SYMBOL_VALUE offset in stack frame. Differs from
+     LOC_LOCAL in that symbol is an argument; differs from LOC_ARG in
+     that we find it in the frame (FRAME_LOCALS_ADDRESS), not in the
+     arglist (FRAME_ARGS_ADDRESS).  Added for i960, which passes args
+     in regs then copies to frame.  */
 
   LOC_LOCAL_ARG,
 
   /* The variable does not actually exist in the program.
-     The SYMBOL_VALUE is ignored.  */
+     The value is ignored.  */
 
   LOC_OPTIMIZED_OUT
 };
@@ -638,6 +619,23 @@ struct linetable_entry
   CORE_ADDR pc;
 };
 
+/* The order of entries in the linetable is significant.
+
+   It should generally be in ascending line number order.  Line table
+   entries for a function at lines 10-40 should come before entries
+   for a function at lines 50-70.
+
+   A for statement looks like this
+
+       10      0x100   - for the init/test part of a for stmt.
+       20      0x200
+       30      0x300
+       10      0x400   - for the increment part of a for stmt.
+
+   FIXME: this description is incomplete.  coffread.c is said to get
+   the linetable order wrong (would arrange_linenos from xcoffread.c
+   work for normal COFF too?).  */
+
 struct linetable
 {
   int nitems;
@@ -1061,8 +1059,10 @@ symbol_file_add PARAMS ((char *, int, CORE_ADDR, int, int, int));
 
 /* source.c */
 
+extern int frame_file_full_name; /* in stack.c */
+
 extern int
-identify_source_line PARAMS ((struct symtab *, int, int));
+identify_source_line PARAMS ((struct symtab *, int, int, CORE_ADDR));
 
 extern void
 print_source_lines PARAMS ((struct symtab *, int, int, int));
This page took 0.028906 seconds and 4 git commands to generate.