X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fosdata.h;h=62075fdf73a138e2d1e1762b5cc44d576dda72ef;hb=3f66685e9e92717af0cafa20480de5548aea7298;hp=f63b0f3f19686d43a069bdbc2c68b152f13c2f4f;hpb=0b30217134add051e159a192066a1e568ebd837f;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/osdata.h b/gdb/osdata.h index f63b0f3f19..62075fdf73 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-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -20,34 +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); + +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 */