X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fosdata.h;h=b0615ed44671af04b28bc0d924ddbb1fe3368b17;hb=51f1fdc3d2235ffe94172b51d33fec0e5c5edeca;hp=4cfb3f866fc7ef1641774ae508ef2900e215b5f8;hpb=f3e0e9604d2bbdbcd4ed17fa35b6ebc3c9360afb;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/osdata.h b/gdb/osdata.h index 4cfb3f866f..b0615ed446 100644 --- a/gdb/osdata.h +++ b/gdb/osdata.h @@ -1,6 +1,6 @@ /* Routines for handling XML generic OS data provided by target. - Copyright (C) 2008-2012 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. This file is part of GDB. @@ -20,35 +20,41 @@ #ifndef OSDATA_H #define OSDATA_H -#include "vec.h" +#include -typedef struct osdata_column +struct osdata_column { - char *name; - char *value; -} osdata_column_s; -DEF_VEC_O(osdata_column_s); + osdata_column (std::string &&name_, std::string &&value_) + : name (std::move (name_)), value (std::move (value_)) + {} -typedef struct osdata_item + std::string name; + std::string value; +}; + +struct osdata_item { - VEC(osdata_column_s) *columns; -} osdata_item_s; -DEF_VEC_O(osdata_item_s); + std::vector columns; +}; struct osdata { - char *type; + osdata (std::string &&type_) + : type (std::move (type_)) + {} - VEC(osdata_item_s) *items; + std::string type; + std::vector items; }; -typedef struct osdata *osdata_p; -DEF_VEC_P(osdata_p); - -struct osdata *osdata_parse (const char *xml); -void osdata_free (struct osdata *); -struct cleanup *make_cleanup_osdata_free (struct osdata *data); -struct osdata *get_osdata (const char *type); -const char *get_osdata_column (struct osdata_item *item, const char *name); -void info_osdata_command (char *type, int from_tty); + +std::unique_ptr osdata_parse (const char *xml); +std::unique_ptr get_osdata (const char *type); +const std::string *get_osdata_column (const osdata_item &item, + const char *name); + +/* Dump TYPE info to the current uiout builder. If TYPE is either + NULL or empty, then dump the top level table that lists the + available types of OS data. */ +void info_osdata (const char *type); #endif /* OSDATA_H */