aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-07-21 15:29:58 +0100
committerPedro Alves <palves@redhat.com>2016-07-21 15:29:58 +0100
commite3821cca157e93677ef098bf36526ccf24f497ac (patch)
tree834984ce93e23b9253c0913f2c94ca04f2aab23f /gdb/varobj.c
parent2583da7cd64e680e43cf92c8022eadee84357b3b (diff)
downloadgdb-e3821cca157e93677ef098bf36526ccf24f497ac.zip
gdb-e3821cca157e93677ef098bf36526ccf24f497ac.tar.gz
gdb-e3821cca157e93677ef098bf36526ccf24f497ac.tar.bz2
Remove unused variable in gdb/varobj.c when built without Python support
gdb/ChangeLog: 2016-07-21 Pedro Alves <palves@redhat.com> * varobj.c (varobj_value_get_print_value): Move "gdbarch" to block scope that uses it.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 6f56cba..fb1349a 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -2453,7 +2453,6 @@ varobj_value_get_print_value (struct value *value,
struct type *type = NULL;
long len = 0;
char *encoding = NULL;
- struct gdbarch *gdbarch = NULL;
/* Initialize it just to avoid a GCC false warning. */
CORE_ADDR str_addr = 0;
int string_print = 0;
@@ -2464,7 +2463,6 @@ varobj_value_get_print_value (struct value *value,
stb = mem_fileopen ();
old_chain = make_cleanup_ui_file_delete (stb);
- gdbarch = get_type_arch (value_type (value));
#if HAVE_PYTHON
if (gdb_python_initialized)
{
@@ -2518,6 +2516,7 @@ varobj_value_get_print_value (struct value *value,
if (s)
{
+ struct gdbarch *gdbarch;
char *hint;
hint = gdbpy_get_display_hint (value_formatter);
@@ -2530,6 +2529,7 @@ varobj_value_get_print_value (struct value *value,
len = strlen (s);
thevalue = (char *) xmemdup (s, len + 1, len + 1);
+ gdbarch = get_type_arch (value_type (value));
type = builtin_type (gdbarch)->builtin_char;
xfree (s);