#include "ui-out.h"
#include "filenames.h"
#include "command.h"
-#include "observer.h"
+#include "observable.h"
#include "objfiles.h"
#include "cli/cli-script.h"
#include "gdbcmd.h"
static void
auto_load_safe_path_vec_update (void)
{
- unsigned len;
- int ix;
-
if (debug_auto_load)
fprintf_unfiltered (gdb_stdlog,
_("auto-load: Updating directories of \"%s\".\n"),
auto_load_safe_path);
auto_load_safe_path_vec = auto_load_expand_dir_vars (auto_load_safe_path);
+ size_t len = auto_load_safe_path_vec.size ();
/* Apply tilde_expand and gdb_realpath to each AUTO_LOAD_SAFE_PATH_VEC
element. */
- for (gdb::unique_xmalloc_ptr<char> &in_vec : auto_load_safe_path_vec)
+ for (size_t i = 0; i < len; i++)
{
+ gdb::unique_xmalloc_ptr<char> &in_vec = auto_load_safe_path_vec[i];
gdb::unique_xmalloc_ptr<char> expanded (tilde_expand (in_vec.get ()));
gdb::unique_xmalloc_ptr<char> real_path = gdb_realpath (expanded.get ());
= register_program_space_data_with_cleanup (NULL,
auto_load_pspace_data_cleanup);
- observer_attach_new_objfile (auto_load_new_objfile);
+ gdb::observers::new_objfile.attach (auto_load_new_objfile);
add_setshow_boolean_cmd ("gdb-scripts", class_support,
&auto_load_gdb_scripts, _("\
show_auto_load_safe_path,
auto_load_set_cmdlist_get (),
auto_load_show_cmdlist_get ());
- observer_attach_gdb_datadir_changed (auto_load_gdb_datadir_changed);
+ gdb::observers::gdb_datadir_changed.attach (auto_load_gdb_datadir_changed);
cmd = add_cmd ("add-auto-load-safe-path", class_support,
add_auto_load_safe_path,