X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fexec.c;h=f94c15f1f53dd9cb127a8b1a05a662343868b9c5;hb=c819b2c0b216c69a4ae5bfba0eac71ffdf1b3596;hp=79baf9c5fbbcdd4fc8b8b13c1e7e0fcb1772ca6c;hpb=b46a8d7c1d50c06e641af99b58301db0499111b9;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/exec.c b/gdb/exec.c index 79baf9c5fb..f94c15f1f5 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -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 #include "solist.h" #include +#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.