From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2934 invoked by alias); 18 Sep 2015 12:06:12 -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 2197 invoked by uid 89); 18 Sep 2015 12:06:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-wi0-f182.google.com Received: from mail-wi0-f182.google.com (HELO mail-wi0-f182.google.com) (209.85.212.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 18 Sep 2015 12:06:11 +0000 Received: by wiclk2 with SMTP id lk2so28164440wic.1 for ; Fri, 18 Sep 2015 05:06:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=64kky6H6dPpwb6NH6L9SIfXpJs/bdqKzS2X/tZ+qZDk=; b=HRDRHwTE1L3ZjAdM6aW8f31cq6xv6YzlP5EDRuHlkTc/a/g+b89nO0YpXNU0Lne0lu yrhDtq6voy/ng2IMJ5Ov2Xtk9dVUlXnh3WXuzYesLFqHVAzSu9kg4LLVFawwdDotiGnw YMLlOOEbV0jChXbZfEjJltT6YOQenZV9B8cKrODV8+8g+VHeM61HMSKZzVv7Yh1exa/H GlfmS2heVciIQY8r8z6tui7O4wL8Xnw/T1apjDa0aoS21KFvZ781522hBj8XmY97D7vU uWDJYbOr7Jq+hKw+E67+P3c1g8wbzW+qAKqtoNdJKkucAy5uWGJ92EcXIEiPC/16ivWF +kvw== X-Gm-Message-State: ALoCoQk5I3IYFPbl8pMXa7dLCG/UrdrcHAcPrykHQ+pxYMuHkYLGA4irONzIjHtNo/3s6OWwj1eH X-Received: by 10.194.185.236 with SMTP id ff12mr6570601wjc.49.1442577967809; Fri, 18 Sep 2015 05:06:07 -0700 (PDT) Received: from localhost (host81-131-206-173.range81-131.btcentralplus.com. [81.131.206.173]) by smtp.gmail.com with ESMTPSA id sd14sm8549257wjb.36.2015.09.18.05.06.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2015 05:06:07 -0700 (PDT) Date: Fri, 18 Sep 2015 12:06:00 -0000 From: Andrew Burgess To: Kevin Buettner Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/8] Add new gdbarch method, unconditional_branch_address Message-ID: <20150918120606.GC10919@embecosm.com> References: <20150818235334.1afb0c85@pinnacle.lan> <20150819000002.06f6a2cf@pinnacle.lan> <20150918120157.GB10919@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150918120157.GB10919@embecosm.com> X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00454.txt.bz2 * Andrew Burgess [2015-09-18 13:01:57 +0100]: > * Kevin Buettner [2015-08-19 00:00:02 -0700]: > > > diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h > > index c1e2c1a..1770960 100644 > > --- a/gdb/gdbarch.h > > +++ b/gdb/gdbarch.h > > @@ -924,7 +924,7 @@ extern void set_gdbarch_max_insn_length (struct gdbarch *gdbarch, ULONGEST max_i > > If your architecture doesn't need to adjust instructions before > > single-stepping them, consider using simple_displaced_step_copy_insn > > here. > > - > > + > > If the instruction cannot execute out of line, return NULL. The > > core falls back to stepping past the instruction in-line instead in > > that case. */ > > @@ -1478,6 +1478,16 @@ typedef int (gdbarch_addressable_memory_unit_size_ftype) (struct gdbarch *gdbarc > > extern int gdbarch_addressable_memory_unit_size (struct gdbarch *gdbarch); > > extern void set_gdbarch_addressable_memory_unit_size (struct gdbarch *gdbarch, gdbarch_addressable_memory_unit_size_ftype *addressable_memory_unit_size); > > > > +/* Examine instruction at PC. If instruction at PC is an unconditional > > + branch, return the address to which control is transferred when the > > + branch is taken. Return 0 when this method is not implemented by > > + architecture, PC refers to an invalid address, or instruction at PC > > + is not an unconditional branch. */ > > + > > +typedef CORE_ADDR (gdbarch_unconditional_branch_address_ftype) (struct gdbarch *gdbarch, CORE_ADDR pc); > > +extern CORE_ADDR gdbarch_unconditional_branch_address (struct gdbarch *gdbarch, CORE_ADDR pc); > > +extern void set_gdbarch_unconditional_branch_address (struct gdbarch *gdbarch, gdbarch_unconditional_branch_address_ftype *unconditional_branch_address); > How would you feel about changing the function so that it returned a > bool and placed the address into a CORE_ADDRESS passed by pointer? Or I could actually spot your revised patch and see you've already done this :-/ Sorry for the noise. Andrew