/* Implementation of the GDB variable objects API.
- Copyright (C) 1999-2020 Free Software Foundation, Inc.
+ Copyright (C) 1999-2022 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "gdbcmd.h"
#include "block.h"
#include "valprint.h"
-#include "gdb_regex.h"
+#include "gdbsupport/gdb_regex.h"
#include "varobj.h"
#include "gdbthread.h"
return py_varobj_get_iterator (var, var->dynamic->pretty_printer);
#endif
- gdb_assert_not_reached (_("\
-requested an iterator from a non-dynamic varobj"));
+ gdb_assert_not_reached ("requested an iterator from a non-dynamic varobj");
}
static bool
}
#endif
+ /* This must be deleted before the root object, because Python-based
+ destructors need access to some components. */
+ delete var->dynamic;
+
if (is_root_p (var))
delete var->root;
-
- delete var->dynamic;
}
/* Return the type of the value that's stored in VAR,
thevalue = std::string (s.get ());
len = thevalue.size ();
- gdbarch = get_type_arch (value_type (value));
+ gdbarch = value_type (value)->arch ();
type = builtin_type (gdbarch)->builtin_char;
if (!string_print)