struct test tval = {23};
+struct test *test_ptr = &tval;
+
int main () {
return 0;
}
mi_gdb_test "-var-list-children --all-values tval" \
".*value=.*flicker.*"
+
+mi_gdb_test "-var-create test_ptr * test_ptr" \
+ "\\^done.*"
+
+mi_gdb_test "-var-evaluate-expression test_ptr" \
+ "\\^done,value=\"map\""
+mi_gdb_test "-var-set-visualizer test_ptr None" \
+ "\\^done.*"
+# mi_gdb_test "-var-update test_ptr" ".*"
+mi_gdb_test "-var-evaluate-expression test_ptr" \
+ "\\^done,value=\"$hex.*\"" \
+ "evaluate without visualizer"
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import gdb
import gdb.printing
lookup_tag = val.type.tag
if lookup_tag == "test":
return TestPrinter(val)
-
+ if val.type.code == gdb.TYPE_CODE_PTR and val.type.target().tag == "test":
+ return TestPrinter(val.dereference())
gdb.printing.register_pretty_printer(None, str_lookup_function)
/* If there are any children now, wipe them. */
varobj_delete (var, 1 /* children only */);
var->num_children = -1;
+
+ /* Also be sure to reset the print value. */
+ varobj_set_display_format (var, var->format);
#else
error (_("Python support required"));
#endif
return "{...}";
}
}
+ else
+ {
+ /* If we've made it here, we don't want a pretty-printer --
+ if we had one, it would already have been used. */
+ opts.raw = true;
+ }
}
#endif