@@ -69,18 +69,24 @@ class gdb_apit
6969 {
7070 pointer_valuet () = delete ;
7171 pointer_valuet (
72- const std::string &address,
73- const std::string &pointee,
74- const std::string &character,
75- const optionalt<std::string> &string)
76- : address(address), pointee(pointee), character(character), string(string)
72+ const std::string &address = " " ,
73+ const std::string &pointee = " " ,
74+ const std::string &character = " " ,
75+ const optionalt<std::string> &string = nullopt ,
76+ const bool valid = false )
77+ : address(address),
78+ pointee (pointee),
79+ character(character),
80+ string(string),
81+ valid(valid)
7782 {
7883 }
7984
8085 const memory_addresst address;
8186 const std::string pointee;
8287 const std::string character;
8388 const optionalt<std::string> string;
89+ bool valid;
8490 };
8591
8692 // / Get the allocated size estimate for a pointer
@@ -103,17 +109,12 @@ class gdb_apit
103109 // / \param corefile: core dump
104110 void run_gdb_from_core (const std::string &corefile);
105111
106- // / Get value of the given value expression
107- // / \param expr: an expression of non-pointer type or pointer to char
108- // / \return value of the expression; if the expression is of type pointer to
109- // / char and represents a string, the string value is returned; otherwise
110- // / the value is returned just as it is printed by gdb
111- std::string get_value (const std::string &expr);
112-
113112 // / Get the memory address pointed to by the given pointer expression
114113 // / \param expr: an expression of pointer type (e.g., `&x` with `x` being of
115114 // / type `int` or `p` with `p` being of type `int *`)
116115 // / \return memory address in hex format
116+ optionalt<std::string> get_value (const std::string &expr);
117+
117118 pointer_valuet get_memory (const std::string &expr);
118119
119120 // / Return the vector of commands that have been written to gdb so far
0 commit comments