* gas/testsuite/gas/sh/pcrel.d: New test.
[deliverable/binutils-gdb.git] / gdb / infrun.c
index fa250068e5ff51261483baa4b38a6184f76eca86..1b0eb7e3e066cbbd006a544d708cccd3c135882f 100644 (file)
@@ -1,6 +1,8 @@
 /* Target-struct-independent code to start (run) and stop an inferior process.
-   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -38,6 +40,7 @@
 #include <signal.h>
 #include "inf-loop.h"
 #include "regcache.h"
+#include "value.h"
 
 /* Prototypes for local functions */
 
@@ -120,14 +123,6 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
 #endif
 
 
-/* Some machines have trampoline code that sits between function callers
-   and the actual functions themselves.  If this machine doesn't have
-   such things, disable their processing.  */
-
-#ifndef SKIP_TRAMPOLINE_CODE
-#define        SKIP_TRAMPOLINE_CODE(pc)        0
-#endif
-
 /* Dynamic function trampolines are similar to solib trampolines in that they
    are between the caller and the callee.  The difference is that when you
    enter a dynamic trampoline, you can't determine the callee's address.  Some
@@ -190,14 +185,6 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
 #define SKIP_SOLIB_RESOLVER(pc) 0
 #endif
 
-/* For SVR4 shared libraries, each call goes through a small piece of
-   trampoline code in the ".plt" section.  IN_SOLIB_CALL_TRAMPOLINE evaluates
-   to nonzero if we are current stopped in one of these. */
-
-#ifndef IN_SOLIB_CALL_TRAMPOLINE
-#define IN_SOLIB_CALL_TRAMPOLINE(pc,name)      0
-#endif
-
 /* In some shared library schemes, the return path from a shared library
    call may need to go through a trampoline too.  */
 
@@ -245,12 +232,10 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
 static void
 default_skip_permanent_breakpoint (void)
 {
-  error_begin ();
-  fprintf_filtered (gdb_stderr, "\
+  error ("\
 The program is stopped at a permanent breakpoint, but GDB does not know\n\
 how to step past a permanent breakpoint on this architecture.  Try using\n\
-a command like `return' or `jump' to continue execution.\n");
-  return_to_top_level (RETURN_ERROR);
+a command like `return' or `jump' to continue execution.");
 }
 #endif
    
@@ -1484,13 +1469,9 @@ handle_inferior_event (struct execution_control_state *ecs)
       {
        add_thread (ecs->ptid);
 
-#ifdef UI_OUT
        ui_out_text (uiout, "[New ");
        ui_out_text (uiout, target_pid_or_tid_to_str (ecs->ptid));
        ui_out_text (uiout, "]\n");
-#else
-       printf_filtered ("[New %s]\n", target_pid_or_tid_to_str (ecs->ptid));
-#endif
 
 #if 0
        /* NOTE: This block is ONLY meant to be invoked in case of a
@@ -1533,15 +1514,12 @@ handle_inferior_event (struct execution_control_state *ecs)
              remove_breakpoints ();
 
            /* Check for any newly added shared libraries if we're
-              supposed to be adding them automatically.  */
-           if (auto_solib_add)
-             {
-               /* Switch terminal for any messages produced by
-                  breakpoint_re_set.  */
-               target_terminal_ours_for_output ();
-               SOLIB_ADD (NULL, 0, NULL);
-               target_terminal_inferior ();
-             }
+              supposed to be adding them automatically.  Switch
+              terminal for any messages produced by
+              breakpoint_re_set.  */
+           target_terminal_ours_for_output ();
+           SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
+           target_terminal_inferior ();
 
            /* Reinsert breakpoints and continue.  */
            if (breakpoints_inserted)
@@ -2461,15 +2439,12 @@ handle_inferior_event (struct execution_control_state *ecs)
            breakpoints_inserted = 0;
 
            /* Check for any newly added shared libraries if we're
-              supposed to be adding them automatically.  */
-           if (auto_solib_add)
-             {
-               /* Switch terminal for any messages produced by
-                  breakpoint_re_set.  */
-               target_terminal_ours_for_output ();
-               SOLIB_ADD (NULL, 0, NULL);
-               target_terminal_inferior ();
-             }
+              supposed to be adding them automatically.  Switch
+              terminal for any messages produced by
+              breakpoint_re_set.  */
+           target_terminal_ours_for_output ();
+           SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
+           target_terminal_inferior ();
 
            /* Try to reenable shared library breakpoints, additional
               code segments in shared libraries might be mapped in now. */
@@ -3305,13 +3280,11 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
     case END_STEPPING_RANGE:
       /* We are done with a step/next/si/ni command. */
       /* For now print nothing. */
-#ifdef UI_OUT
       /* Print a message only if not in the middle of doing a "step n"
         operation for n > 1 */
       if (!step_multi || !stop_step)
        if (ui_out_is_mi_like_p (uiout))
          ui_out_field_string (uiout, "reason", "end-stepping-range");
-#endif
       break;
     case BREAKPOINT_HIT:
       /* We found a breakpoint. */
@@ -3319,7 +3292,6 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
       break;
     case SIGNAL_EXITED:
       /* The inferior was terminated by a signal. */
-#ifdef UI_OUT
       annotate_signalled ();
       if (ui_out_is_mi_like_p (uiout))
        ui_out_field_string (uiout, "reason", "exited-signalled");
@@ -3333,25 +3305,9 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
       annotate_signal_string_end ();
       ui_out_text (uiout, ".\n");
       ui_out_text (uiout, "The program no longer exists.\n");
-#else
-      annotate_signalled ();
-      printf_filtered ("\nProgram terminated with signal ");
-      annotate_signal_name ();
-      printf_filtered ("%s", target_signal_to_name (stop_info));
-      annotate_signal_name_end ();
-      printf_filtered (", ");
-      annotate_signal_string ();
-      printf_filtered ("%s", target_signal_to_string (stop_info));
-      annotate_signal_string_end ();
-      printf_filtered (".\n");
-
-      printf_filtered ("The program no longer exists.\n");
-      gdb_flush (gdb_stdout);
-#endif
       break;
     case EXITED:
       /* The inferior program is finished. */
-#ifdef UI_OUT
       annotate_exited (stop_info);
       if (stop_info)
        {
@@ -3367,19 +3323,10 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
            ui_out_field_string (uiout, "reason", "exited-normally");
          ui_out_text (uiout, "\nProgram exited normally.\n");
        }
-#else
-      annotate_exited (stop_info);
-      if (stop_info)
-       printf_filtered ("\nProgram exited with code 0%o.\n",
-                        (unsigned int) stop_info);
-      else
-       printf_filtered ("\nProgram exited normally.\n");
-#endif
       break;
     case SIGNAL_RECEIVED:
       /* Signal received. The signal table tells us to print about
          it. */
-#ifdef UI_OUT
       annotate_signal ();
       ui_out_text (uiout, "\nProgram received signal ");
       annotate_signal_name ();
@@ -3392,19 +3339,6 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
       ui_out_field_string (uiout, "signal-meaning", target_signal_to_string (stop_info));
       annotate_signal_string_end ();
       ui_out_text (uiout, ".\n");
-#else
-      annotate_signal ();
-      printf_filtered ("\nProgram received signal ");
-      annotate_signal_name ();
-      printf_filtered ("%s", target_signal_to_name (stop_info));
-      annotate_signal_name_end ();
-      printf_filtered (", ");
-      annotate_signal_string ();
-      printf_filtered ("%s", target_signal_to_string (stop_info));
-      annotate_signal_string_end ();
-      printf_filtered (".\n");
-      gdb_flush (gdb_stdout);      
-#endif
       break;
     default:
       internal_error (__FILE__, __LINE__,
@@ -3548,18 +3482,14 @@ and/or watchpoints.\n");
              internal_error (__FILE__, __LINE__,
                              "Unknown value.");
            }
-#ifdef UI_OUT
          /* For mi, have the same behavior every time we stop:
              print everything but the source line. */
          if (ui_out_is_mi_like_p (uiout))
            source_flag = LOC_AND_ADDRESS;
-#endif
 
-#ifdef UI_OUT
          if (ui_out_is_mi_like_p (uiout))
            ui_out_field_int (uiout, "thread-id",
                              pid_to_thread_id (inferior_ptid));
-#endif
          /* The behavior of this routine with respect to the source
             flag is:
             SRC_LINE: Print only source line
This page took 0.025859 seconds and 4 git commands to generate.