]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* Makefile.in (c-exp.tab.o): Remove notice about shift/reduce conflicts
authorJim Kingdon <jkingdon@engr.sgi.com>
Thu, 21 Oct 1993 20:41:50 +0000 (20:41 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Thu, 21 Oct 1993 20:41:50 +0000 (20:41 +0000)
which no longer occur.

gcc -Wall lint:
* findvar.c (symbol_read_needs_frame), corelow.c (ignore),
inflow.c (gdb_has_a_terminal): Make sure to return a value.
* regex.h: Declare re_set_syntax.
* printcmd.c: Include valprint.h.
* infcmd.c, exec.c, maint.c, core.c: Include language.h.
* maint.c: Include expression.h.
* infrun.c, fork-child.c, corelow.c, inflow.c: Include thread.h.
* inftarg.c: Include command.h.
* coredep.c: Include value.h.
* c-exp.y, m2-exp.y, ch-exp.y: Include bfd.h, symfile.h and objfiles.h.
* ch-typeprint.c: Include typeprint.h.
* ch-valprint.c: Include c-lang.h.
* nlmread.c: Include buildsym.h.
* environ.c: Include gdbcore.h.  Only include defs.h once.
(set_in_environ): Cast const char * to char * when passing to
set_gnutarget.
Remove unused variables:
* printcmd.c (printf_command): args_to_vprintf.
* coffread.c (coff_symfile_init): strsection.
Move variables to within the #ifdefs where they are used:
* symtab.c (gdb_mangle_name): opname.
* inftarg.c (child_attach): pid and exec_file.
* inftarg.c (child_detach): siggnal.
* objfiles.c (allocate_objfile): mapto, md, and fd.
* objfiles.c (free_objfile): mmfd.
* infrun.c (wait_for_inferior): Include BPSTAT_WHAT_LAST in switch.
* infrun.c (wait_for_inferior): Remove unused same_pid label.
* inferior.h: Declare set_sigint_trap and clear_sigint_trap.
* parser-defs.h: Declare write_exp_elt_block.
* stabsread.h: Declare elfstab_offset_sections and
coffstab_build_psymtabs.

23 files changed:
gdb/ChangeLog
gdb/Makefile.in
gdb/buildsym.c
gdb/c-exp.y
gdb/ch-exp.y
gdb/ch-typeprint.c
gdb/ch-valprint.c
gdb/coffread.c
gdb/core.c
gdb/coredep.c
gdb/corelow.c
gdb/findvar.c
gdb/fork-child.c
gdb/inferior.h
gdb/infrun.c
gdb/inftarg.c
gdb/m2-exp.y
gdb/maint.c
gdb/nlmread.c
gdb/objfiles.c
gdb/parser-defs.h
gdb/regex.h
gdb/stabsread.h

index c51fee7a80cba3b01af390f47f060cf9898ce8ad..4b88ca2406634e9445588f851a1179efb858323e 100644 (file)
@@ -1,3 +1,41 @@
+Thu Oct 21 12:23:12 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * Makefile.in (c-exp.tab.o): Remove notice about shift/reduce conflicts
+       which no longer occur.
+
+       gcc -Wall lint:
+       * findvar.c (symbol_read_needs_frame), corelow.c (ignore),
+       inflow.c (gdb_has_a_terminal): Make sure to return a value.
+       * regex.h: Declare re_set_syntax.
+       * printcmd.c: Include valprint.h.
+       * infcmd.c, exec.c, maint.c, core.c: Include language.h.
+       * maint.c: Include expression.h.
+       * infrun.c, fork-child.c, corelow.c, inflow.c: Include thread.h.
+       * inftarg.c: Include command.h.
+       * coredep.c: Include value.h.
+       * c-exp.y, m2-exp.y, ch-exp.y: Include bfd.h, symfile.h and objfiles.h.
+       * ch-typeprint.c: Include typeprint.h.
+       * ch-valprint.c: Include c-lang.h.
+       * nlmread.c: Include buildsym.h.
+       * environ.c: Include gdbcore.h.  Only include defs.h once.
+       (set_in_environ): Cast const char * to char * when passing to
+       set_gnutarget.
+       Remove unused variables:
+       * printcmd.c (printf_command): args_to_vprintf.
+       * coffread.c (coff_symfile_init): strsection.
+       Move variables to within the #ifdefs where they are used:
+       * symtab.c (gdb_mangle_name): opname.
+       * inftarg.c (child_attach): pid and exec_file.
+       * inftarg.c (child_detach): siggnal.
+       * objfiles.c (allocate_objfile): mapto, md, and fd.
+       * objfiles.c (free_objfile): mmfd.
+       * infrun.c (wait_for_inferior): Include BPSTAT_WHAT_LAST in switch.
+       * infrun.c (wait_for_inferior): Remove unused same_pid label.
+       * inferior.h: Declare set_sigint_trap and clear_sigint_trap.
+       * parser-defs.h: Declare write_exp_elt_block.
+       * stabsread.h: Declare elfstab_offset_sections and
+       coffstab_build_psymtabs.
+
 Thu Oct 21 12:05:08 1993  Ken Raeburn  (raeburn@cygnus.com)
 
        Patch from Jeff Law:
index 21094a847c5bc3908a0275da6b6d5be48f2f6b40..26ffeb00a205a39cafb3743b9880ce866cd442a8 100644 (file)
@@ -730,7 +730,6 @@ version.c: Makefile
 # else.
 c-exp.tab.o: c-exp.tab.c
 c-exp.tab.c: c-exp.y Makefile.in
-       @echo 'Expect 6 shift/reduce conflicts.'
        $(YACC) $(YFLAGS) $(srcdir)/c-exp.y
        -sed -e '/extern.*malloc/d' \
             -e '/extern.*realloc/d' \
index dfa9be1316259f657848cfb14c31c0df5083c9e5..58eb157e6116da5de0185a7115a0f11844df2963 100644 (file)
@@ -39,6 +39,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "buildsym.h"          /* Our own declarations */
 #undef EXTERN
 
+/* For cleanup_undefined_types and finish_global_stabs (somewhat
+   questionable--see comment where we call them).  */
+#include "stabsread.h"
+
 static int
 compare_line_numbers PARAMS ((const void *, const void *));
 
index 65f7537958c0741fb6041dcd8498828eda46c8fd..dd7de2d40bd535ff65b8c0a1ae26342cd1bfd4e2 100644 (file)
@@ -42,6 +42,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "value.h"
 #include "language.h"
 #include "c-lang.h"
+#include "bfd.h" /* Required by objfiles.h.  */
+#include "symfile.h" /* Required by objfiles.h.  */
+#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 
 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
    as well as gratuitiously global symbol names, so we can have multiple
index b6370f3241f035ac0198163dc75a232092fb043f..c544a4e899172e7c29a360e2db1221788570b823 100644 (file)
@@ -60,6 +60,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "value.h"
 #include "parser-defs.h"
 #include "ch-lang.h"
+#include "bfd.h" /* Required by objfiles.h.  */
+#include "symfile.h" /* Required by objfiles.h.  */
+#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 
 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
    as well as gratuitiously global symbol names, so we can have multiple
index c3cdcd2a18852a2b5989c15036f55b5a478be699..06318b4eefcc0d1d818c3e506fff4ed2de8b9ae0 100644 (file)
@@ -31,6 +31,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "language.h"
 #include "demangle.h"
 #include "ch-lang.h"
+#include "typeprint.h"
 
 #include <string.h>
 #include <errno.h>
index 261b22ee62c6be248115cd199367e11cb38b2b20..3e7f18e2612aa674b07d117e806493f5a3406734 100644 (file)
@@ -26,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "value.h"
 #include "language.h"
 #include "demangle.h"
+#include "c-lang.h" /* For c_val_print */
 
 static void
 chill_print_value_fields PARAMS ((struct type *, char *, FILE *, int, int,
index ffe00d5c813da31b96579164e27f344d137a733e..48b3ca5b6be861b31493952d3e21bca2804451f9 100644 (file)
@@ -513,7 +513,7 @@ static void
 coff_symfile_init (objfile)
      struct objfile *objfile;
 {
-  asection     *section, *strsection;
+  asection     *section;
   bfd *abfd = objfile->obfd;
 
   /* Allocate struct to keep track of stab reading. */
index 36c9ab5e75a05e3319e0117d156732e9c65ab006..9126d94ddb6d7eb07413a18c6c19e6e864154c3d 100644 (file)
@@ -30,6 +30,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "target.h"
 #include "gdbcore.h"
 #include "dis-asm.h"
+#include "language.h"
 
 extern char registers[];
 
index d94fd9820c9d487b5d3bfe523a9414df70b14404..ae309800c8fecd70e32f09c410db3f90df06a974 100644 (file)
@@ -24,6 +24,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/types.h>
 #include <sys/param.h>
 #include "gdbcore.h"
+#include "value.h" /* For supply_register.  */
 
 /* These are needed on various systems to expand REGISTER_U_ADDR.  */
 #ifndef USG
index 1cebc48985ec9f14ed71217893596fa05c71113a..717a6ee326b4e84954a56ac881b857f298796f82 100644 (file)
@@ -28,6 +28,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "bfd.h"
 #include "target.h"
 #include "gdbcore.h"
+#include "thread.h"
 
 static void
 core_files_info PARAMS ((struct target_ops *));
@@ -299,6 +300,7 @@ ignore (addr, contents)
      CORE_ADDR addr;
      char *contents;
 {
+  return 0;
 }
 
 struct target_ops core_ops = {
index 50d5da6bf8753e5d216fd28fac3b75776acf2b76..fe9fc3694256fb8faf5c6b38f75156ff74051089 100644 (file)
@@ -555,6 +555,7 @@ symbol_read_needs_frame (sym)
     case LOC_OPTIMIZED_OUT:
       return 0;
     }
+  return 1;
 }
 
 /* Given a struct symbol for a variable,
@@ -896,8 +897,12 @@ value_from_register (type, regnum, frame)
          /* eg a variable of type `float' in a 68881 register
             with raw type `extended' and virtual type `double'.
             Fetch it as a `double' and then convert to `float'.  */
+         /* FIXME: This value will be not_lval, which means we can't assign
+            to it.  Probably the right fix is to do the cast on a temporary
+            value, and just copy the VALUE_CONTENTS over.  */
          v = allocate_value (REGISTER_VIRTUAL_TYPE (regnum));
-         memcpy (VALUE_CONTENTS_RAW (v), virtual_buffer, len);
+         memcpy (VALUE_CONTENTS_RAW (v), virtual_buffer,
+                 REGISTER_VIRTUAL_SIZE (regnum));
          v = value_cast (type, v);
        }
       else
index 3c01b6021eb51d9f1675f059cb152b999a7ae894..e5a16c523cc86de0f6ee769a48afb4962a6bfe11 100644 (file)
@@ -25,6 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "wait.h"
 #include "gdbcore.h"
 #include "terminal.h"
+#include "thread.h"
 
 #include <signal.h>
 
index f0dddda38c15cd04153d1c5017d9b206ef4e94e6..6fdad93659fa717716e15384f92a7124475c31d6 100644 (file)
@@ -36,9 +36,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  * control variables.
  */
 struct inferior_status {
-  int pc_changed;
   int stop_signal;
-  int stop_pc;
+  CORE_ADDR stop_pc;
   FRAME_ADDR stop_frame_address;
   bpstat stop_bpstat;
   int stop_step;
@@ -55,6 +54,12 @@ struct inferior_status {
   FRAME_ADDR selected_frame_address;
   int selected_level;
   char stop_registers[REGISTER_BYTES];
+
+  /* These are here because if call_function_by_hand has written some
+     registers and then decides to call error(), we better not have changed
+     any registers.  */
+  char registers[REGISTER_BYTES];
+
   int breakpoint_proceeded;
   int restore_stack_info;
   int proceed_to_finish;
@@ -66,6 +71,9 @@ save_inferior_status PARAMS ((struct inferior_status *, int));
 extern void
 restore_inferior_status PARAMS ((struct inferior_status *));
 
+extern void set_sigint_trap PARAMS ((void));
+extern void clear_sigint_trap PARAMS ((void));
+
 /* File name for default use for standard in/out in the inferior.  */
 
 extern char *inferior_io_terminal;
@@ -98,8 +106,7 @@ generic_mourn_inferior PARAMS ((void));
 extern void
 terminal_ours PARAMS ((void));
 
-extern void
-run_stack_dummy PARAMS ((char*, CORE_ADDR, char [REGISTER_BYTES]));
+extern int run_stack_dummy PARAMS ((CORE_ADDR, char [REGISTER_BYTES]));
 
 extern CORE_ADDR
 read_pc PARAMS ((void));
@@ -171,7 +178,7 @@ void
 detach PARAMS ((int));
 
 extern void
-child_resume PARAMS ((int, int));
+child_resume PARAMS ((int, int, int));
 
 #ifndef PTRACE_ARG3_TYPE
 #define PTRACE_ARG3_TYPE int   /* Correct definition for most systems. */
@@ -260,7 +267,12 @@ extern int stopped_by_random_signal;
 
 /* Range to single step within.
    If this is nonzero, respond to a single-step signal
-   by continuing to step if the pc is in this range.  */
+   by continuing to step if the pc is in this range.
+
+   If step_range_start and step_range_end are both 1, it means to step for
+   a single instruction (FIXME: it might clean up wait_for_inferior in a
+   minor way if this were changed to the address of the instruction and
+   that address plus one.  But maybe not.).  */
 
 extern CORE_ADDR step_range_start; /* Inclusive */
 extern CORE_ADDR step_range_end; /* Exclusive */
@@ -301,11 +313,6 @@ extern int proceed_to_finish;
 
 extern char stop_registers[REGISTER_BYTES];
 
-/* Nonzero if pc has been changed by the debugger
-   since the inferior stopped.  */
-
-extern int pc_changed;
-
 /* Nonzero if the child process in inferior_pid was attached rather
    than forked.  */
 
@@ -338,6 +345,7 @@ extern int attach_flag;
 #define ON_STACK 1
 #define BEFORE_TEXT_END 2
 #define AFTER_TEXT_END 3
+#define AT_ENTRY_POINT 4
 
 #if !defined (CALL_DUMMY_LOCATION)
 #define CALL_DUMMY_LOCATION ON_STACK
@@ -352,14 +360,16 @@ extern CORE_ADDR text_end;
 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
   ((pc) >= text_end - CALL_DUMMY_LENGTH         \
    && (pc) <= text_end + DECR_PC_AFTER_BREAK)
-#else /* Not before text_end.  */
+#endif /* Before text_end.  */
+
 #if CALL_DUMMY_LOCATION == AFTER_TEXT_END
 extern CORE_ADDR text_end;
 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
   ((pc) >= text_end   \
    && (pc) <= text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK)
-#else /* On stack.  */
+#endif /* After text_end.  */
 
+#if CALL_DUMMY_LOCATION == ON_STACK
 /* Is the PC in a call dummy?  SP and FRAME_ADDRESS are the bottom and
    top of the stack frame which we are checking, where "bottom" and
    "top" refer to some section of memory which contains the code for
@@ -381,7 +391,14 @@ extern CORE_ADDR text_end;
 #define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
   ((sp) INNER_THAN (pc) && (frame_address != 0) && (pc) INNER_THAN (frame_address))
 #endif /* On stack.  */
-#endif /* Not before text_end.  */
+
+#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
+extern CORE_ADDR
+entry_point_address PARAMS ((void));
+#define PC_IN_CALL_DUMMY(pc, sp, frame_address)                        \
+  ((pc) >= entry_point_address ()                              \
+   && (pc) <= (entry_point_address () + DECR_PC_AFTER_BREAK))
+#endif /* At entry point.  */
 #endif /* No PC_IN_CALL_DUMMY.  */
 
 #endif /* !defined (INFERIOR_H) */
index da5862299ed85f918f52e09c29deb1c4296cf426..85ebb38f108699b5e3d90290c2ef1786e077e571 100644 (file)
@@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "gdbcore.h"
 #include "gdbcmd.h"
 #include "target.h"
+#include "thread.h"
 
 #include <signal.h>
 
@@ -583,8 +584,6 @@ switch_thread:
            }
        }
 
-same_pid:
-
 #ifdef NO_SINGLE_STEP
       if (one_stepped)
        single_step (0);        /* This actually cleans up the ss */
@@ -845,6 +844,9 @@ same_pid:
               cleanup chain, so no need to worry about it here.  */
            goto stop_stepping;
 
+         case BPSTAT_WHAT_LAST:
+           /* Not a real code, but listed here to shut up gcc -Wall.  */
+
          case BPSTAT_WHAT_KEEP_CHECKING:
            break;
          }
@@ -1001,7 +1003,7 @@ same_pid:
              /* If we end up in certain places, it means we did a subroutine
                 call.  I'm not completely sure this is necessary now that we
                 have the above checks with stop_func_start (and now that
-                find_pc_partial_function is pickier.  */
+                find_pc_partial_function is pickier).  */
              || IN_SOLIB_TRAMPOLINE (stop_pc, stop_func_name)
 
              /* If none of the above apply, it is a jump within a function,
index 3270fa687bbe3ac35633ebe6640d91fc86d95034..2c110ab5b32c2c8693a812ff80fe3e292bee8414 100644 (file)
@@ -24,7 +24,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "target.h"
 #include "wait.h"
 #include "gdbcore.h"
-
+#include "command.h"
 #include <signal.h>
 
 static void
@@ -32,7 +32,7 @@ child_prepare_to_store PARAMS ((void));
 
 #ifndef CHILD_WAIT
 static int
-child_wait PARAMS ((int *));
+child_wait PARAMS ((int, int *));
 #endif /* CHILD_WAIT */
 
 static void
@@ -110,35 +110,38 @@ child_attach (args, from_tty)
      char *args;
      int from_tty;
 {
-  char *exec_file;
-  int pid;
-
   if (!args)
     error_no_arg ("process-id to attach");
 
 #ifndef ATTACH_DETACH
   error ("Can't attach to a process on this machine.");
 #else
-  pid = atoi (args);
+  {
+    char *exec_file;
+    int pid;
+
+    pid = atoi (args);
 
-  if (pid == getpid())         /* Trying to masturbate? */
-    error ("I refuse to debug myself!");
+    if (pid == getpid())               /* Trying to masturbate? */
+      error ("I refuse to debug myself!");
 
-  if (from_tty)
-    {
-      exec_file = (char *) get_exec_file (0);
+    if (from_tty)
+      {
+       exec_file = (char *) get_exec_file (0);
 
-      if (exec_file)
-       printf ("Attaching to program `%s', %s\n", exec_file, target_pid_to_str (pid));
-      else
-       printf ("Attaching to %s\n", target_pid_to_str (pid));
+       if (exec_file)
+         printf ("Attaching to program `%s', %s\n", exec_file,
+                 target_pid_to_str (pid));
+       else
+         printf ("Attaching to %s\n", target_pid_to_str (pid));
 
-      fflush (stdout);
-    }
+       fflush (stdout);
+      }
 
-  attach (pid);
-  inferior_pid = pid;
-  push_target (&child_ops);
+    attach (pid);
+    inferior_pid = pid;
+    push_target (&child_ops);
+  }
 #endif  /* ATTACH_DETACH */
 }
 
@@ -156,26 +159,28 @@ child_detach (args, from_tty)
      char *args;
      int from_tty;
 {
-  int siggnal = 0;
-
 #ifdef ATTACH_DETACH
-  if (from_tty)
-    {
-      char *exec_file = get_exec_file (0);
-      if (exec_file == 0)
-       exec_file = "";
-      printf ("Detaching from program: %s %s\n", exec_file,
-             target_pid_to_str (inferior_pid));
-      fflush (stdout);
-    }
-  if (args)
-    siggnal = atoi (args);
-  
-  detach (siggnal);
-  inferior_pid = 0;
-  unpush_target (&child_ops);          /* Pop out of handling an inferior */
+  {
+    int siggnal = 0;
+
+    if (from_tty)
+      {
+       char *exec_file = get_exec_file (0);
+       if (exec_file == 0)
+         exec_file = "";
+       printf ("Detaching from program: %s %s\n", exec_file,
+               target_pid_to_str (inferior_pid));
+       fflush (stdout);
+      }
+    if (args)
+      siggnal = atoi (args);
+
+    detach (siggnal);
+    inferior_pid = 0;
+    unpush_target (&child_ops);
+  }
 #else
-    error ("This version of Unix does not support detaching a process.");
+  error ("This version of Unix does not support detaching a process.");
 #endif
 }
 
index cc4001fa984cd432d1fb21cd6ff913e4a7156be9..07448b18a313c97ade6cf10110822513aab4fb5f 100644 (file)
@@ -44,6 +44,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "value.h"
 #include "parser-defs.h"
 #include "m2-lang.h"
+#include "bfd.h" /* Required by objfiles.h.  */
+#include "symfile.h" /* Required by objfiles.h.  */
+#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 
 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
    as well as gratuitiously global symbol names, so we can have multiple
index b5334512ab48a4d0c0726ce2cfa8b617cda743b4..7addd4e7eb2ccc11b2bb8b2dac7468f3d3cd2132 100644 (file)
@@ -30,6 +30,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "gdbtypes.h"
 #include "demangle.h"
 #include "gdbcore.h"
+#include "expression.h" /* For language.h */
+#include "language.h"
 
 static void
 maintenance_command PARAMS ((char *, int));
index fde3af2493287509307b48e9b39fe8e1fd2773bf..8ad444432ed543d1ffd66376fca80beb85895537 100644 (file)
@@ -24,6 +24,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "symfile.h"
 #include "objfiles.h"
 #include "gdb-stabs.h"
+#include "buildsym.h"
 
 static void
 nlm_new_init PARAMS ((struct objfile *));
index b111f005c05db44fa2d7c6c87fa2180ba355c0b7..b890657c99efe1d922d1be48180ee3173f7f11c2 100644 (file)
@@ -120,79 +120,88 @@ allocate_objfile (abfd, mapped)
      int mapped;
 {
   struct objfile *objfile = NULL;
-  int fd;
-  PTR md;
-  CORE_ADDR mapto;
 
   mapped |= mapped_symbol_files;
 
 #if !defined(NO_MMALLOC) && defined(HAVE_MMAP)
+  {
 
-  /* If we can support mapped symbol files, try to open/reopen the mapped file
-     that corresponds to the file from which we wish to read symbols.  If the
-     objfile is to be mapped, we must malloc the structure itself using the
-     mmap version, and arrange that all memory allocation for the objfile uses
-     the mmap routines.  If we are reusing an existing mapped file, from which
-     we get our objfile pointer, we have to make sure that we update the
-     pointers to the alloc/free functions in the obstack, in case these
-     functions have moved within the current gdb. */
-
-  fd = open_mapped_file (bfd_get_filename (abfd), bfd_get_mtime (abfd),
-                        mapped);
-  if (fd >= 0)
-    {
-      if (((mapto = map_to_address ()) == 0) ||
-         ((md = mmalloc_attach (fd, (PTR) mapto)) == NULL))
-       {
-         close (fd);
-       }
-      else if ((objfile = (struct objfile *) mmalloc_getkey (md, 0)) != NULL)
-       {
-         /* Update memory corruption handler function addresses. */
-         init_malloc (md);
-         objfile -> md = md;
-         objfile -> mmfd = fd;
-         /* Update pointers to functions to *our* copies */
-         obstack_chunkfun (&objfile -> psymbol_obstack, xmmalloc);
-         obstack_freefun (&objfile -> psymbol_obstack, mfree);
-         obstack_chunkfun (&objfile -> symbol_obstack, xmmalloc);
-         obstack_freefun (&objfile -> symbol_obstack, mfree);
-         obstack_chunkfun (&objfile -> type_obstack, xmmalloc);
-         obstack_freefun (&objfile -> type_obstack, mfree);
-         /* If already in objfile list, unlink it. */
-         unlink_objfile (objfile);
-         /* Forget things specific to a particular gdb, may have changed. */
-         objfile -> sf = NULL;
-       }
-      else
-       {
-         /* Set up to detect internal memory corruption.  MUST be done before
-            the first malloc.  See comments in init_malloc() and mmcheck(). */
-         init_malloc (md);
-         objfile = (struct objfile *) xmmalloc (md, sizeof (struct objfile));
-         memset (objfile, 0, sizeof (struct objfile));
-         objfile -> md = md;
-         objfile -> mmfd = fd;
-         objfile -> flags |= OBJF_MAPPED;
-         mmalloc_setkey (objfile -> md, 0, objfile);
-         obstack_specify_allocation_with_arg (&objfile -> psymbol_obstack,
-                                              0, 0, xmmalloc, mfree,
-                                              objfile -> md);
-         obstack_specify_allocation_with_arg (&objfile -> symbol_obstack,
-                                              0, 0, xmmalloc, mfree,
-                                              objfile -> md);
-         obstack_specify_allocation_with_arg (&objfile -> type_obstack,
-                                              0, 0, xmmalloc, mfree,
-                                              objfile -> md);
-       }
-    }
+    /* If we can support mapped symbol files, try to open/reopen the
+       mapped file that corresponds to the file from which we wish to
+       read symbols.  If the objfile is to be mapped, we must malloc
+       the structure itself using the mmap version, and arrange that
+       all memory allocation for the objfile uses the mmap routines.
+       If we are reusing an existing mapped file, from which we get
+       our objfile pointer, we have to make sure that we update the
+       pointers to the alloc/free functions in the obstack, in case
+       these functions have moved within the current gdb.  */
+
+    int fd;
+
+    fd = open_mapped_file (bfd_get_filename (abfd), bfd_get_mtime (abfd),
+                          mapped);
+    if (fd >= 0)
+      {
+       CORE_ADDR mapto;
+       PTR md;
 
-  if (mapped && (objfile == NULL))
-    {
-      warning ("symbol table for '%s' will not be mapped",
-              bfd_get_filename (abfd));
-    }
+       if (((mapto = map_to_address ()) == 0) ||
+           ((md = mmalloc_attach (fd, (PTR) mapto)) == NULL))
+         {
+           close (fd);
+         }
+       else if ((objfile = (struct objfile *) mmalloc_getkey (md, 0)) != NULL)
+         {
+           /* Update memory corruption handler function addresses. */
+           init_malloc (md);
+           objfile -> md = md;
+           objfile -> mmfd = fd;
+           /* Update pointers to functions to *our* copies */
+           obstack_chunkfun (&objfile -> psymbol_obstack, xmmalloc);
+           obstack_freefun (&objfile -> psymbol_obstack, mfree);
+           obstack_chunkfun (&objfile -> symbol_obstack, xmmalloc);
+           obstack_freefun (&objfile -> symbol_obstack, mfree);
+           obstack_chunkfun (&objfile -> type_obstack, xmmalloc);
+           obstack_freefun (&objfile -> type_obstack, mfree);
+           /* If already in objfile list, unlink it. */
+           unlink_objfile (objfile);
+           /* Forget things specific to a particular gdb, may have changed. */
+           objfile -> sf = NULL;
+         }
+       else
+         {
 
+           /* Set up to detect internal memory corruption.  MUST be
+              done before the first malloc.  See comments in
+              init_malloc() and mmcheck().  */
+
+           init_malloc (md);
+
+           objfile = (struct objfile *)
+             xmmalloc (md, sizeof (struct objfile));
+           memset (objfile, 0, sizeof (struct objfile));
+           objfile -> md = md;
+           objfile -> mmfd = fd;
+           objfile -> flags |= OBJF_MAPPED;
+           mmalloc_setkey (objfile -> md, 0, objfile);
+           obstack_specify_allocation_with_arg (&objfile -> psymbol_obstack,
+                                                0, 0, xmmalloc, mfree,
+                                                objfile -> md);
+           obstack_specify_allocation_with_arg (&objfile -> symbol_obstack,
+                                                0, 0, xmmalloc, mfree,
+                                                objfile -> md);
+           obstack_specify_allocation_with_arg (&objfile -> type_obstack,
+                                                0, 0, xmmalloc, mfree,
+                                                objfile -> md);
+         }
+      }
+
+    if (mapped && (objfile == NULL))
+      {
+       warning ("symbol table for '%s' will not be mapped",
+                bfd_get_filename (abfd));
+      }
+  }
 #else  /* defined(NO_MMALLOC) || !defined(HAVE_MMAP) */
 
   if (mapped)
@@ -304,8 +313,6 @@ void
 free_objfile (objfile)
      struct objfile *objfile;
 {
-  int mmfd;
-
   /* First do any symbol file specific actions required when we are
      finished with a particular symbol file.  Note that if the objfile
      is using reusable symbol information (via mmalloc) then each of
@@ -362,6 +369,8 @@ free_objfile (objfile)
     {
       /* Remember the fd so we can close it.  We can't close it before
         doing the detach, and after the detach the objfile is gone. */
+      int mmfd;
+
       mmfd = objfile -> mmfd;
       mmalloc_detach (objfile -> md);
       objfile = NULL;
index 5c8710e4e6e2e7a9458f1a5a42764690fb1cfc25..2e2b9e834b69d85e4e2d8b7a79fd6ba425c325f0 100644 (file)
@@ -85,32 +85,25 @@ union type_stack_elt {
 union type_stack_elt *type_stack;
 int type_stack_depth, type_stack_size;
 
-extern void
-write_exp_elt PARAMS ((union exp_element));
+extern void write_exp_elt PARAMS ((union exp_element));
 
-extern void
-write_exp_elt_opcode PARAMS ((enum exp_opcode));
+extern void write_exp_elt_opcode PARAMS ((enum exp_opcode));
 
-extern void
-write_exp_elt_sym PARAMS ((struct symbol *));
+extern void write_exp_elt_sym PARAMS ((struct symbol *));
 
-extern void
-write_exp_elt_longcst PARAMS ((LONGEST));
+extern void write_exp_elt_longcst PARAMS ((LONGEST));
 
-extern void
-write_exp_elt_dblcst PARAMS ((double));
+extern void write_exp_elt_dblcst PARAMS ((double));
 
-extern void
-write_exp_elt_type PARAMS ((struct type *));
+extern void write_exp_elt_type PARAMS ((struct type *));
 
-extern void
-write_exp_elt_intern PARAMS ((struct internalvar *));
+extern void write_exp_elt_intern PARAMS ((struct internalvar *));
 
-extern void
-write_exp_string PARAMS ((struct stoken));
+extern void write_exp_string PARAMS ((struct stoken));
 
-extern void
-write_exp_bitstring PARAMS ((struct stoken));
+extern void write_exp_bitstring PARAMS ((struct stoken));
+
+extern void write_exp_elt_block PARAMS ((struct block *));
 
 extern void
 start_arglist PARAMS ((void));
index 6348c3eb6e4550dada2e42bfb2067264db0df044..a4ed6d3591e0080f73ae08e58e3de0f9b3bc2c2b 100644 (file)
@@ -177,3 +177,5 @@ extern int re_exec ();
 #ifdef SYNTAX_TABLE
 extern char *re_syntax_table;
 #endif
+
+extern int re_set_syntax ();
index 3b890d8058407e8e2bcefe058e7cfcb036ab7f38..984d72586f327537e6e74f2a333aa3305cab40aa 100644 (file)
@@ -179,13 +179,24 @@ extern void
 process_one_symbol PARAMS ((int, int, CORE_ADDR, char *,
                            struct section_offsets *, struct objfile *));
 
-extern void
-elfstab_build_psymtabs PARAMS ((struct objfile *objfile,
-                               struct section_offsets *section_offsets,
-                               int mainline,
-                               file_ptr staboff, unsigned int stabsize,
-                               file_ptr stabstroffset,
-                               unsigned int stabstrsize));
+extern void elfstab_build_psymtabs
+  PARAMS ((struct objfile *objfile,
+          struct section_offsets *section_offsets,
+          int mainline,
+          file_ptr staboff, unsigned int stabsize,
+          file_ptr stabstroffset,
+          unsigned int stabstrsize));
+
+extern void coffstab_build_psymtabs
+  PARAMS ((struct objfile *objfile,
+          struct section_offsets *section_offsets,
+          int mainline,
+          file_ptr staboff, unsigned int stabsize,
+          file_ptr stabstroffset,
+          unsigned int stabstrsize));
+
+extern void elfstab_offset_sections PARAMS ((struct objfile *,
+                                            struct partial_symtab *));
 
 extern void
 pastab_build_psymtabs PARAMS ((struct objfile *, struct section_offsets *,