From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129199 invoked by alias); 18 Sep 2015 02:03:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 129189 invoked by uid 89); 18 Sep 2015 02:03:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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; Fri, 18 Sep 2015 02:03:27 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 1B91BA0BAA for ; Fri, 18 Sep 2015 02:03:26 +0000 (UTC) Received: from pinnacle.lan (ovpn-113-104.phx2.redhat.com [10.3.113.104]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8I23OUM007675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO) for ; Thu, 17 Sep 2015 22:03:25 -0400 Date: Fri, 18 Sep 2015 02:03:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: Re: [PATCH 4/8] Implement unconditional_branch_address method for x86-64 and i386 Message-ID: <20150917190323.2e30f4f0@pinnacle.lan> In-Reply-To: <20150819000629.5a0ecc4e@pinnacle.lan> References: <20150818235334.1afb0c85@pinnacle.lan> <20150819000629.5a0ecc4e@pinnacle.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00434.txt.bz2 Here is an updated patch for x86_64 and i386. Implement unconditional_branch_destination method for x86-64 and i386. =20=20=20=20 gdb/ChangeLog: =20=20=20=20 * i386-tdep.c (i386_unconditional_branch_destination): New function. (i386_gdbarch_init): Register i386_unconditional_branch_destination. --- gdb/i386-tdep.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 9d52d4a..4fd9f6e 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8237,6 +8237,23 @@ i386_validate_tdesc_p (struct gdbarch_tdep *tdep, return valid_p; } =20 +/* Implement the unconditional_branch_destination gdbarch method. */ + +static int +i386_unconditional_branch_destination (struct gdbarch *gdbarch, CORE_ADDR = pc, + CORE_ADDR *dest) +{ + CORE_ADDR new_pc =3D i386_follow_jump (gdbarch, pc); + + if (new_pc =3D=3D pc) + return 0; + else + { + *dest =3D new_pc; + return 1; + } +} + =0C static struct gdbarch * i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) @@ -8582,6 +8599,10 @@ i386_gdbarch_init (struct gdbarch_info info, struct = gdbarch_list *arches) set_gdbarch_fast_tracepoint_valid_at (gdbarch, i386_fast_tracepoint_valid_at); =20 + /* Unconditional Branch. */ + set_gdbarch_unconditional_branch_destination + (gdbarch, i386_unconditional_branch_destination); + return gdbarch; } =20