C++-ify typedef hash
[deliverable/binutils-gdb.git] / gdb / exec.c
index 79baf9c5fbbcdd4fc8b8b13c1e7e0fcb1772ca6c..f94c15f1f53dd9cb127a8b1a05a662343868b9c5 100644 (file)
@@ -29,7 +29,7 @@
 #include "completer.h"
 #include "value.h"
 #include "exec.h"
-#include "observer.h"
+#include "observable.h"
 #include "arch-utils.h"
 #include "gdbthread.h"
 #include "progspace.h"
@@ -45,6 +45,7 @@
 #include <sys/stat.h>
 #include "solist.h"
 #include <algorithm>
+#include "common/pathstuff.h"
 
 void (*deprecated_file_changed_hook) (const char *);
 
@@ -290,12 +291,10 @@ exec_file_attach (const char *filename, int from_tty)
        }
       else
        {
-         char *temp_pathname;
-
          scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST,
                                filename, write_files ?
                                O_RDWR | O_BINARY : O_RDONLY | O_BINARY,
-                               &temp_pathname);
+                               &scratch_storage);
 #if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__)
          if (scratch_chan < 0)
            {
@@ -306,14 +305,13 @@ exec_file_attach (const char *filename, int from_tty)
                                    exename, write_files ?
                                    O_RDWR | O_BINARY
                                    : O_RDONLY | O_BINARY,
-                                   &temp_pathname);
+                                   &scratch_storage);
            }
 #endif
          if (scratch_chan < 0)
            perror_with_name (filename);
 
-         scratch_storage.reset (temp_pathname);
-         scratch_pathname = temp_pathname;
+         scratch_pathname = scratch_storage.get ();
 
          /* gdb_bfd_open (and its variants) prefers canonicalized
             pathname for better BFD caching.  */
@@ -380,7 +378,7 @@ exec_file_attach (const char *filename, int from_tty)
     }
 
   bfd_cache_close_all ();
-  observer_notify_executable_changed ();
+  gdb::observers::executable_changed.notify ();
 }
 
 /*  Process the first arg in ARGS as the new exec file.
This page took 0.025465 seconds and 4 git commands to generate.