From cde5ef40f807cf37ac4fc5adcf621c615049eda9 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Sat, 23 Nov 2013 15:58:04 +0800 Subject: [PATCH] Rename varobj_pretty_printed_p to varobj_is_dynamic_p We think varobj with --available-children-only behaves like a dynamic varobj, so dyanmic varobj is not pretty-printer specific. We rename varobj_pretty_printed_p to varobj_is_dynamic_p, so that we can handle available-children-only checking in varobj_is_dynamic_p in the next patch. gdb: 2014-06-12 Yao Qi * varobj.c (varobj_pretty_printed_p): Rename to ... (varobj_is_dynamic_p): ... this. New function. * varobj.h (varobj_pretty_printed_p): Remove declaration. (varobj_is_dynamic_p): Declare. * mi/mi-cmd-var.c (print_varobj): All callers updated. (mi_print_value_p, varobj_update_one): Likewise. --- gdb/ChangeLog | 9 +++++++++ gdb/mi/mi-cmd-var.c | 6 +++--- gdb/varobj.c | 4 +++- gdb/varobj.h | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 03ba56a009b..55146f40ac6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2014-06-12 Yao Qi + + * varobj.c (varobj_pretty_printed_p): Rename to ... + (varobj_is_dynamic_p): ... this. New function. + * varobj.h (varobj_pretty_printed_p): Remove declaration. + (varobj_is_dynamic_p): Declare. + * mi/mi-cmd-var.c (print_varobj): All callers updated. + (mi_print_value_p, varobj_update_one): Likewise. + 2014-06-12 Pedro Alves Yao Qi diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index f68dba62b60..90596161a7f 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -88,7 +88,7 @@ print_varobj (struct varobj *var, enum print_values print_values, xfree (display_hint); } - if (varobj_pretty_printed_p (var)) + if (varobj_is_dynamic_p (var)) ui_out_field_int (uiout, "dynamic", 1); } @@ -352,7 +352,7 @@ mi_print_value_p (struct varobj *var, enum print_values print_values) if (print_values == PRINT_ALL_VALUES) return 1; - if (varobj_pretty_printed_p (var)) + if (varobj_is_dynamic_p (var)) return 1; type = varobj_get_gdb_type (var); @@ -777,7 +777,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values, xfree (display_hint); } - if (varobj_pretty_printed_p (r->varobj)) + if (varobj_is_dynamic_p (r->varobj)) ui_out_field_int (uiout, "dynamic", 1); varobj_get_child_range (r->varobj, &from, &to); diff --git a/gdb/varobj.c b/gdb/varobj.c index b9712581e24..94050c6ebd5 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1066,8 +1066,10 @@ varobj_get_attributes (struct varobj *var) return attributes; } +/* Return true if VAR is a dynamic varobj. */ + int -varobj_pretty_printed_p (struct varobj *var) +varobj_is_dynamic_p (struct varobj *var) { return var->dynamic->pretty_printer != NULL; } diff --git a/gdb/varobj.h b/gdb/varobj.h index 991c2e8f9e1..74d41cf0cf1 100644 --- a/gdb/varobj.h +++ b/gdb/varobj.h @@ -306,7 +306,7 @@ extern void varobj_enable_pretty_printing (void); extern int varobj_has_more (struct varobj *var, int to); -extern int varobj_pretty_printed_p (struct varobj *var); +extern int varobj_is_dynamic_p (struct varobj *var); extern struct cleanup *varobj_ensure_python_env (struct varobj *var); -- 2.30.2