From patchwork Thu Jul 21 11:37:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 13902 Received: (qmail 128657 invoked by alias); 21 Jul 2016 11:38:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 128612 invoked by uid 89); 21 Jul 2016 11:38:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Jul 2016 11:38:00 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F38F663E2C for ; Thu, 21 Jul 2016 11:37:58 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6LBbviG027702 for ; Thu, 21 Jul 2016 07:37:58 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 1/2] Remove unused variable in gdb/varobj.c when built without Python support Date: Thu, 21 Jul 2016 12:37:56 +0100 Message-Id: <1469101077-18220-1-git-send-email-palves@redhat.com> In-Reply-To: <7797fc3a-9651-3448-2def-3bc5b0c5cf55@redhat.com> References: <7797fc3a-9651-3448-2def-3bc5b0c5cf55@redhat.com> gdb/ChangeLog: yyyy-mm-dd Pedro Alves * varobj.c (varobj_value_get_print_value): Move "gdbarch" to block scope that uses it. --- gdb/varobj.c | 4 ++-- 1 file 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);