2004-01-18 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / infrun.c
index 7283aa7ab82e73762def2a572388ebbe3bb9267d..1ecbcc6a7a96ff739038f98686a1e523779f4771 100644 (file)
@@ -2,8 +2,8 @@
    process.
 
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
-   Foundation, Inc.
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -61,9 +61,6 @@ static int hook_stop_stub (void *);
 
 static void delete_breakpoint_current_contents (void *);
 
-static void set_follow_fork_mode_command (char *arg, int from_tty,
-                                         struct cmd_list_element *c);
-
 static int restore_selected_frame (void *);
 
 static void build_infrun (void);
@@ -340,12 +337,10 @@ static struct
 }
 pending_follow;
 
-static const char follow_fork_mode_ask[] = "ask";
 static const char follow_fork_mode_child[] = "child";
 static const char follow_fork_mode_parent[] = "parent";
 
 static const char *follow_fork_mode_kind_names[] = {
-  follow_fork_mode_ask,
   follow_fork_mode_child,
   follow_fork_mode_parent,
   NULL
@@ -357,16 +352,7 @@ static const char *follow_fork_mode_string = follow_fork_mode_parent;
 static int
 follow_fork (void)
 {
-  const char *follow_mode = follow_fork_mode_string;
-  int follow_child = (follow_mode == follow_fork_mode_child);
-
-  /* Or, did the user not know, and want us to ask? */
-  if (follow_fork_mode_string == follow_fork_mode_ask)
-    {
-      internal_error (__FILE__, __LINE__,
-                     "follow_inferior_fork: \"ask\" mode not implemented");
-      /* follow_mode = follow_fork_mode_...; */
-    }
+  int follow_child = (follow_fork_mode_string == follow_fork_mode_child);
 
   return target_follow_fork (follow_child);
 }
@@ -987,8 +973,7 @@ struct execution_control_state
 
 void init_execution_control_state (struct execution_control_state *ecs);
 
-static void handle_step_into_function (struct execution_control_state *ecs,
-                                       CORE_ADDR real_stop_pc);
+static void handle_step_into_function (struct execution_control_state *ecs);
 void handle_inferior_event (struct execution_control_state *ecs);
 
 static void check_sigtramp2 (struct execution_control_state *ecs);
@@ -1242,9 +1227,10 @@ pc_in_sigtramp (CORE_ADDR pc)
    into a function.  */
 
 static void
-handle_step_into_function (struct execution_control_state *ecs,
-                           CORE_ADDR real_stop_pc)
+handle_step_into_function (struct execution_control_state *ecs)
 {
+  CORE_ADDR real_stop_pc;
+
   if ((step_over_calls == STEP_OVER_NONE)
       || ((step_range_end == 1)
           && in_prologue (prev_pc, ecs->stop_func_start)))
@@ -1334,7 +1320,6 @@ handle_step_into_function (struct execution_control_state *ecs,
 void
 handle_inferior_event (struct execution_control_state *ecs)
 {
-  CORE_ADDR real_stop_pc;
   /* NOTE: cagney/2003-03-28: If you're looking at this code and
      thinking that the variable stepped_after_stopped_by_watchpoint
      isn't used, then you're wrong!  The macro STOPPED_BY_WATCHPOINT,
@@ -2569,7 +2554,7 @@ process_event_stop_test:
       || ecs->stop_func_name == 0)
     {
       /* It's a subroutine call.  */
-      handle_step_into_function (ecs, real_stop_pc);
+      handle_step_into_function (ecs);
       return;
     }
 
@@ -2592,7 +2577,7 @@ process_event_stop_test:
   if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
     {
       /* Determine where this trampoline returns.  */
-      real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+      CORE_ADDR real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
 
       /* Only proceed through if we know where it's going.  */
       if (real_stop_pc)
@@ -2955,17 +2940,6 @@ keep_going (struct execution_control_state *ecs)
       if (stop_signal == TARGET_SIGNAL_TRAP && !signal_program[stop_signal])
        stop_signal = TARGET_SIGNAL_0;
 
-#ifdef SHIFT_INST_REGS
-      /* I'm not sure when this following segment applies.  I do know,
-         now, that we shouldn't rewrite the regs when we were stopped
-         by a random signal from the inferior process.  */
-      /* FIXME: Shouldn't this be based on the valid bit of the SXIP?
-         (this is only used on the 88k).  */
-
-      if (!bpstat_explains_signal (stop_bpstat)
-         && (stop_signal != TARGET_SIGNAL_CHLD) && !stopped_by_random_signal)
-       SHIFT_INST_REGS ();
-#endif /* SHIFT_INST_REGS */
 
       resume (currently_stepping (ecs), stop_signal);
     }
@@ -4076,31 +4050,12 @@ to the user would be loading/unloading of a new library.\n", &setlist), &showlis
   c = add_set_enum_cmd ("follow-fork-mode",
                        class_run,
                        follow_fork_mode_kind_names, &follow_fork_mode_string,
-/* ??rehrauer:  The "both" option is broken, by what may be a 10.20
-   kernel problem.  It's also not terribly useful without a GUI to
-   help the user drive two debuggers.  So for now, I'm disabling
-   the "both" option.  */
-/*                      "Set debugger response to a program call of fork \
-   or vfork.\n\
-   A fork or vfork creates a new process.  follow-fork-mode can be:\n\
-   parent  - the original process is debugged after a fork\n\
-   child   - the new process is debugged after a fork\n\
-   both    - both the parent and child are debugged after a fork\n\
-   ask     - the debugger will ask for one of the above choices\n\
-   For \"both\", another copy of the debugger will be started to follow\n\
-   the new child process.  The original debugger will continue to follow\n\
-   the original parent process.  To distinguish their prompts, the\n\
-   debugger copy's prompt will be changed.\n\
-   For \"parent\" or \"child\", the unfollowed process will run free.\n\
-   By default, the debugger will follow the parent process.",
- */
                        "Set debugger response to a program call of fork \
 or vfork.\n\
 A fork or vfork creates a new process.  follow-fork-mode can be:\n\
   parent  - the original process is debugged after a fork\n\
   child   - the new process is debugged after a fork\n\
-  ask     - the debugger will ask for one of the above choices\n\
-For \"parent\" or \"child\", the unfollowed process will run free.\n\
+The unfollowed process will continue to run.\n\
 By default, the debugger will follow the parent process.", &setlist);
   add_show_from_set (c, &showlist);
 
This page took 0.026186 seconds and 4 git commands to generate.