/* Create mutable addrmap. */
auto_obstack temp_obstack;
- auto map = gdb::make_unique<struct addrmap_mutable> ();
+ auto map = std::make_unique<struct addrmap_mutable> ();
SELF_CHECK (map != nullptr);
/* Check initial state. */
if (*arg == '\0')
arg = nullptr;
- auto c = gdb::make_unique<solib_catchpoint> (gdbarch, is_temp, nullptr,
+ auto c = std::make_unique<solib_catchpoint> (gdbarch, is_temp, nullptr,
is_load, arg);
c->enable_state = enabled ? bp_enabled : bp_disabled;
error (_("The loaded version of GCC does not support the required version "
"of the API."));
- return gdb::make_unique<INSTTYPE> (context);
+ return std::make_unique<INSTTYPE> (context);
}
/* A C-language implementation of get_compile_context. */
state.demangle_info = allocate_info ();
- auto result = gdb::make_unique<demangle_parse_info> ();
+ auto result = std::make_unique<demangle_parse_info> ();
result->info = state.demangle_info;
if (yyparse (&state))
options, memory);
if (ret)
{
- auto info = gdb::make_unique<demangle_parse_info> ();
+ auto info = std::make_unique<demangle_parse_info> ();
info->tree = ret;
*demangled_p = NULL;
return info;
struct gdbarch *gdbarch = objfile->arch ();
/* Build a minimal decoding of the DWARF2 compilation unit. */
- auto unit = gdb::make_unique<comp_unit> (objfile);
+ auto unit = std::make_unique<comp_unit> (objfile);
if (objfile->separate_debug_objfile_backlink == NULL)
{
bool
dwarf2_read_debug_names (dwarf2_per_objfile *per_objfile)
{
- auto map = gdb::make_unique<mapped_debug_names> ();
+ auto map = std::make_unique<mapped_debug_names> ();
mapped_debug_names dwz_map;
struct objfile *objfile = per_objfile->objfile;
dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
if (main_index_contents.empty ())
return 0;
- auto map = gdb::make_unique<mapped_gdb_index> ();
+ auto map = std::make_unique<mapped_gdb_index> ();
if (!read_gdb_index_from_buffer (objfile_name (objfile),
use_deprecated_index_sections,
main_index_contents, map.get (), &cu_list,
static std::unique_ptr<type_unit_group>
create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct)
{
- auto tu_group = gdb::make_unique<type_unit_group> ();
+ auto tu_group = std::make_unique<type_unit_group> ();
tu_group->hash.dwo_unit = cu->dwo_unit;
tu_group->hash.line_sect_off = line_offset_struct;
const char *target)
{
std::unique_ptr<target_buffer> buffer
- = gdb::make_unique<target_buffer> (addr, size);
+ = std::make_unique<target_buffer> (addr, size);
return gdb_bfd_openr_iovec (buffer->filename (), target,
[&] (bfd *nbfd)
void
allocate_fixed_point_type_info (struct type *type)
{
- auto up = gdb::make_unique<fixed_point_type_info> ();
+ auto up = std::make_unique<fixed_point_type_info> ();
fixed_point_type_info *info;
if (type->is_objfile_owned ())
= gdb::checked_static_cast<mi_interp *> (command_interp ());
try
{
- command = gdb::make_unique<mi_parse> (cmd, &token);
+ command = std::make_unique<mi_parse> (cmd, &token);
}
catch (const gdb_exception &exception)
{
mi_out_new (const char *mi_version)
{
if (streq (mi_version, INTERP_MI4) || streq (mi_version, INTERP_MI))
- return gdb::make_unique<mi_ui_out> (4);
+ return std::make_unique<mi_ui_out> (4);
if (streq (mi_version, INTERP_MI3))
- return gdb::make_unique<mi_ui_out> (3);
+ return std::make_unique<mi_ui_out> (3);
if (streq (mi_version, INTERP_MI2))
- return gdb::make_unique<mi_ui_out> (2);
+ return std::make_unique<mi_ui_out> (2);
return nullptr;
}
error (_("BTS support has been disabled for the target cpu."));
std::unique_ptr<linux_btrace_target_info> tinfo
- { gdb::make_unique<linux_btrace_target_info> (ptid) };
+ { std::make_unique<linux_btrace_target_info> (ptid) };
tinfo->conf.format = BTRACE_FORMAT_BTS;
pid = ptid.pid ();
std::unique_ptr<linux_btrace_target_info> tinfo
- { gdb::make_unique<linux_btrace_target_info> (ptid) };
+ { std::make_unique<linux_btrace_target_info> (ptid) };
tinfo->conf.format = BTRACE_FORMAT_PT;
try
{
scoped_restore save_uiout = make_scoped_restore (¤t_uiout, &uiout);
- auto parser = gdb::make_unique<mi_parse> (std::move (mi_command),
+ auto parser = std::make_unique<mi_parse> (std::move (mi_command),
std::move (arg_strings));
mi_execute_command (parser.get ());
}
error (_("Could not get children iterator"));
}
- return gdb::make_unique<py_varobj_iter> (var, std::move (iter), opts);
+ return std::make_unique<py_varobj_iter> (var, std::move (iter), opts);
}
new_solib->so_original_name = so_name;
new_solib->so_name = so_name;
- new_solib->lm_info = gdb::make_unique<lm_info_aix> (info);
+ new_solib->lm_info = std::make_unique<lm_info_aix> (info);
/* Add it to the list. */
sos.push_back (*new_solib);
/* Create and fill the new struct shobj element. */
shobj *newobj = new shobj;
- auto li = gdb::make_unique<lm_info_darwin> ();
+ auto li = std::make_unique<lm_info_darwin> ();
newobj->so_name = file_path.get ();
newobj->so_original_name = newobj->so_name;
}
shobj *sop = new shobj;
- auto li = gdb::make_unique<lm_info_dsbt> ();
+ auto li = std::make_unique<lm_info_dsbt> ();
li->map = loadmap;
/* Fetch the name. */
addr = extract_unsigned_integer (lm_buf.l_name,
}
shobj *sop = new shobj;
- auto li = gdb::make_unique<lm_info_frv> ();
+ auto li = std::make_unique<lm_info_frv> ();
li->map = loadmap;
li->got_value = got_addr;
li->lm_addr = lm_addr;
for (const rocm_so &so : sos)
{
struct shobj *newobj = new struct shobj;
- newobj->lm_info = gdb::make_unique<lm_info_svr4> (*so.lm_info);
+ newobj->lm_info = std::make_unique<lm_info_svr4> (*so.lm_info);
newobj->so_name = so.name;
newobj->so_original_name = so.unique_name;
gdb::unique_xmalloc_ptr<char> uri_bytes_holder (uri_bytes);
- lm_info_svr4_up li = gdb::make_unique<lm_info_svr4> ();
+ lm_info_svr4_up li = std::make_unique<lm_info_svr4> ();
li->l_addr = l_addr;
/* Generate a unique name so that code objects with the same URI but
type *ptr_type
= builtin_type (current_inferior ()->arch ())->builtin_data_ptr;
- lm_info = gdb::make_unique<lm_info_svr4> ();
+ lm_info = std::make_unique<lm_info_svr4> ();
lm_info->lm_addr = lm_addr;
lm_info->l_addr_inferior = extract_typed_address (&lm[lmo->l_addr_offset],
newobj->so_name = so.name;
newobj->so_original_name = so.name;
- newobj->lm_info = gdb::make_unique<lm_info_svr4> (*so.lm_info);
+ newobj->lm_info = std::make_unique<lm_info_svr4> (*so.lm_info);
dst.push_back (*newobj);
}
ULONGEST *l_ldp
= (ULONGEST *) xml_find_attribute (attributes, "l_ld")->value.get ();
- lm_info_svr4_up li = gdb::make_unique<lm_info_svr4> ();
+ lm_info_svr4_up li = std::make_unique<lm_info_svr4> ();
li->lm_addr = *lmp;
li->l_addr_inferior = *l_addrp;
li->l_ld = *l_ldp;
return {};
shobj *newobj = new shobj;
- auto li = gdb::make_unique<lm_info_svr4> ();
+ auto li = std::make_unique<lm_info_svr4> ();
/* Nothing will ever check the other fields if we set l_addr_p. */
li->l_addr = li->l_addr_inferior = info->debug_loader_offset;
internal_error (_("table header must be specified after table_begin and "
"before table_body."));
- auto header = gdb::make_unique<ui_out_hdr> (m_headers.size () + 1,
+ auto header = std::make_unique<ui_out_hdr> (m_headers.size () + 1,
width, alignment,
col_name, col_hdr);
void
ui_out::push_level (ui_out_type type)
{
- auto level = gdb::make_unique<ui_out_level> (type);
+ auto level = std::make_unique<ui_out_level> (type);
m_levels.push_back (std::move (level));
}
{
if (start == end)
any_empty_tasks = true;
- return gdb::make_unique<int> (end - start);
+ return std::make_unique<int> (end - start);
});
SELF_CHECK (!any_empty_tasks);
SELF_CHECK (std::all_of (intresults.begin (),
{
if (start == end)
any_empty_tasks = true;
- return gdb::make_unique<int> (end - start);
+ return std::make_unique<int> (end - start);
},
task_size_one);
SELF_CHECK (!any_empty_tasks);
const char *expression, CORE_ADDR frame, enum varobj_type type)
{
/* Fill out a varobj structure for the (root) variable being constructed. */
- auto var = gdb::make_unique<varobj> (new varobj_root);
+ auto var = std::make_unique<varobj> (new varobj_root);
if (expression != NULL)
{
void operator() (T *ptr) const { }
};
-/* Create simple std::unique_ptr<T> objects. */
-
-template<typename T, typename... Arg>
-std::unique_ptr<T>
-make_unique (Arg &&...args)
-{
-#if __cplusplus >= 201402L
- return std::make_unique<T> (std::forward<Arg> (args)...);
-#else
- return std::unique_ptr<T> (new T (std::forward<Arg> (args)...));
-#endif /* __cplusplus < 201402L */
-}
-
} /* namespace gdb */
/* Dup STR and return a unique_xmalloc_ptr for the result. */