]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/osdata.c
Add two methods to tui_data_window
[thirdparty/binutils-gdb.git] / gdb / osdata.c
index 5c41cb1374c8823d37d0970347a85cfc17be7ae1..ea3b7dce43b0c8a33400864c5a96880574cd3716 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "target.h"
-#include "vec.h"
+#include "gdbsupport/vec.h"
 #include "xml-support.h"
 #include "osdata.h"
 #include "ui-out.h"
@@ -163,11 +163,11 @@ std::unique_ptr<osdata>
 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?"));
@@ -175,7 +175,7 @@ get_osdata (const char *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)