projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NEWS: Note that the FreeBSD async target supports async mode.
[binutils-gdb.git]
/
gdb
/
varobj-iter.h
diff --git
a/gdb/varobj-iter.h
b/gdb/varobj-iter.h
index 3a530bc658d5c190facf0aba972da41d354cfc98..4bbf386e9dc4ee0af7fc3f95a9242fafe4792e03 100644
(file)
--- a/
gdb/varobj-iter.h
+++ b/
gdb/varobj-iter.h
@@
-1,5
+1,5
@@
/* Iterator of varobj.
/* Iterator of varobj.
- Copyright (C) 2013-20
14
Free Software Foundation, Inc.
+ Copyright (C) 2013-20
22
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-14,50
+14,29
@@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-struct varobj_iter_ops;
+#ifndef VAROBJ_ITER_H
+#define VAROBJ_ITER_H
-typedef PyObject varobj_item;
+/* A node or item of varobj, composed of the name and the value. */
-/* A dynamic varobj iterator "class". */
-
-struct varobj_iter
+struct varobj_item
{
{
- /*
The 'vtable'
. */
-
const struct varobj_iter_ops *ops
;
+ /*
Name of this item
. */
+
std::string name
;
- /* The varobj this iterator is listing children for. */
- struct varobj *var;
-
- /* The next raw index we will try to check is available. If it is
- equal to number_of_children, then we've already iterated the
- whole set. */
- int next_raw_index;
+ /* Value of this item. */
+ value_ref_ptr value;
};
};
-/*
The vtable of the varobj iterator class
. */
+/*
A dynamic varobj iterator "class"
. */
-struct varobj_iter
_ops
+struct varobj_iter
{
{
- /* Destructor. Releases everything from SELF (but not SELF
- itself). */
- void (*dtor) (struct varobj_iter *self);
-
- /* Returns the next object or NULL if it has reached the end. */
- varobj_item *(*next) (struct varobj_iter *self);
-};
+public:
-/* Returns the next varobj or NULL if it has reached the end. */
+ virtual ~varobj_iter () = default;
-#define varobj_iter_next(ITER) (ITER)->ops->next (ITER)
-
-/* Delete a varobj_iter object. */
+ virtual std::unique_ptr<varobj_item> next () = 0;
+};
-#define varobj_iter_delete(ITER) \
- do \
- { \
- if ((ITER) != NULL) \
- { \
- (ITER)->ops->dtor (ITER); \
- xfree (ITER); \
- } \
- } while (0)
+#endif /* VAROBJ_ITER_H */