Fix a failure in the libiberty testsuite by increasing the recursion limit to 2048.
[deliverable/binutils-gdb.git] / gdb / exec.c
index 6e44b0e821bec95d6b64425e2dfd953dfe15bba3..44b212a4d4443b8282528dd838867501c849b84c 100644 (file)
@@ -60,12 +60,11 @@ Specify the filename of the executable file.")
 
 struct exec_target final : public target_ops
 {
-  exec_target ()
-  { to_stratum = file_stratum; }
-
   const target_info &info () const override
   { return exec_target_info; }
 
+  strata stratum () const override { return file_stratum; }
+
   void close () override;
   enum target_xfer_status xfer_partial (enum target_object object,
                                        const char *annex,
@@ -149,11 +148,8 @@ void
 try_open_exec_file (const char *exec_file_host, struct inferior *inf,
                    symfile_add_flags add_flags)
 {
-  struct cleanup *old_chain;
   struct gdb_exception prev_err = exception_none;
 
-  old_chain = make_cleanup (free_current_contents, &prev_err.message);
-
   /* exec_file_attach and symbol_file_add_main may throw an error if the file
      cannot be opened either locally or remotely.
 
@@ -165,6 +161,7 @@ try_open_exec_file (const char *exec_file_host, struct inferior *inf,
      Even without a symbol file, the remote-based debugging session should
      continue normally instead of ending abruptly.  Hence we catch thrown
      errors/exceptions in the following code.  */
+  std::string saved_message;
   TRY
     {
       /* We must do this step even if exec_file_host is NULL, so that
@@ -180,7 +177,10 @@ try_open_exec_file (const char *exec_file_host, struct inferior *inf,
 
       /* Save message so it doesn't get trashed by the catch below.  */
       if (err.message != NULL)
-       prev_err.message = xstrdup (err.message);
+       {
+         saved_message = err.message;
+         prev_err.message = saved_message.c_str ();
+       }
     }
   END_CATCH
 
@@ -197,8 +197,6 @@ try_open_exec_file (const char *exec_file_host, struct inferior *inf,
        }
       END_CATCH
     }
-
-  do_cleanups (old_chain);
 }
 
 /* See gdbcore.h.  */
This page took 0.024558 seconds and 4 git commands to generate.