This patch adds a new convenience variable called "$_exitsignal", which
[deliverable/binutils-gdb.git] / gdb / corelow.c
index 7a5aaabf7c692383dda9fb1a328e6b93dddc34de..d1e7f6ae7df6c285a3e3b6dd404483fade0a651d 100644 (file)
@@ -429,6 +429,9 @@ core_open (char *filename, int from_tty)
   if (p)
     printf_filtered (_("Core was generated by `%s'.\n"), p);
 
+  /* Clearing any previous state of convenience variables.  */
+  clear_exit_convenience_vars ();
+
   siggy = bfd_core_file_failing_signal (core_bfd);
   if (siggy > 0)
     {
@@ -446,6 +449,11 @@ core_open (char *filename, int from_tty)
 
       printf_filtered (_("Program terminated with signal %s, %s.\n"),
                       gdb_signal_to_name (sig), gdb_signal_to_string (sig));
+
+      /* Set the value of the internal variable $_exitsignal,
+        which holds the signal uncaught by the inferior.  */
+      set_internalvar_integer (lookup_internalvar ("_exitsignal"),
+                              siggy);
     }
 
   /* Fetch all registers from core file.  */
This page took 0.032456 seconds and 4 git commands to generate.