From patchwork Wed Feb 1 00:10:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 19074 Received: (qmail 53320 invoked by alias); 1 Feb 2017 00:10:33 -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 53276 invoked by uid 89); 1 Feb 2017 00:10:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=2017-02-01, 20170201, miinterpc, sk:mi_brea 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 ESMTP; Wed, 01 Feb 2017 00:10:28 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 4C2EFC05681A for ; Wed, 1 Feb 2017 00:10:28 +0000 (UTC) Received: from cascais.lan (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v110ARJ3006119 for ; Tue, 31 Jan 2017 19:10:27 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [ob/pushed] Use gdb_insn_length instead of creating dummy stream Date: Wed, 1 Feb 2017 00:10:26 +0000 Message-Id: <1485907826-24955-1-git-send-email-palves@redhat.com> gdb/ChangeLog: 2017-02-01 Pedro Alves * i386-tdep.c (i386_fast_tracepoint_valid_at): Use gdb_insn_length. --- gdb/ChangeLog | 4 ++++ gdb/i386-tdep.c | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 91cde2b..710b181 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2017-02-01 Pedro Alves + + * i386-tdep.c (i386_fast_tracepoint_valid_at): Use gdb_insn_length. + 2017-01-31 Pedro Alves * mi/mi-interp.c (mi_breakpoint_created, mi_breakpoint_modified): diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 8a4d59f..b86c623 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8110,7 +8110,6 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, char **msg) { int len, jumplen; - static struct ui_file *gdb_null = NULL; /* Ask the target for the minimum instruction length supported. */ jumplen = target_get_min_fast_tracepoint_insn_len (); @@ -8133,12 +8132,8 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, jumplen = (register_size (gdbarch, 0) == 8) ? 5 : 4; } - /* Dummy file descriptor for the disassembler. */ - if (!gdb_null) - gdb_null = ui_file_new (); - /* Check for fit. */ - len = gdb_print_insn (gdbarch, addr, gdb_null, NULL); + len = gdb_insn_length (gdbarch, addr); if (len < jumplen) {