/* Routines for handling XML generic OS data provided by target.
- Copyright (C) 2008-2018 Free Software Foundation, Inc.
+ Copyright (C) 2008-2019 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "target.h"
-#include "vec.h"
#include "xml-support.h"
#include "osdata.h"
#include "ui-out.h"
get_osdata (const char *type)
{
std::unique_ptr<osdata> osdata;
- gdb::unique_xmalloc_ptr<char> xml = target_get_osdata (type);
+ gdb::optional<gdb::char_vector> xml = target_get_osdata (type);
if (xml)
{
- if (xml.get ()[0] == '\0')
+ if ((*xml)[0] == '\0')
{
if (type)
warning (_("Empty data returned by target. Wrong osdata type?"));
warning (_("Empty type list returned by target. No type data?"));
}
else
- osdata = osdata_parse (xml.get ());
+ osdata = osdata_parse (xml->data ());
}
if (osdata == NULL)