From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3822 invoked by alias); 10 Mar 2014 09:23:31 -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 3809 invoked by uid 89); 10 Mar 2014 09:23:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-we0-f174.google.com Received: from mail-we0-f174.google.com (HELO mail-we0-f174.google.com) (74.125.82.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 10 Mar 2014 09:23:29 +0000 Received: by mail-we0-f174.google.com with SMTP id t60so8275915wes.33 for ; Mon, 10 Mar 2014 02:23:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=u9mobsrdbFNYOSUZg84zmv11UkluzUSLMr7bdncxK3M=; b=XifLfidnHtOZXG++2GftQ7qpNkZg+aigD2SMWwNoOFwp0Gk5JVKQiNruUN6l1vULnb KQZyt6kYsZIhtr7rGNSUykNoGZYv3QgrMQANRyM4mOkaf1JCoOKkss9Wmgg5Pw3L9FNx WUL3s+/6V09nm8EYYKdXkudi3atWNfpnKY99hgIgonhydl/k8ItXx1LTCMcCUggtfsYR gAZDYVu/HdTeaaWDvN1C+5JJmOJYbPyUNEdFdt6vvuNjvEPTLHGwqmqL5H9LD2Q8GDzD pSW7efJAnAkO/zPLaAp/T5rbxXUczt7TVRbq0dbmEee641kr8j0vVFkWDlc+CESFaV1W Q2oQ== X-Gm-Message-State: ALoCoQlTvf5ijlQy8pE/e9NBgBAH6VDIXuBsCm9LoWaMXkK1kN1uynZwt89LkUANX9VjmLwF+lb4 X-Received: by 10.194.175.202 with SMTP id cc10mr939836wjc.48.1394443405717; Mon, 10 Mar 2014 02:23:25 -0700 (PDT) Received: from [192.168.0.134] (cust64-dsl91-135-5.idnet.net. [91.135.5.64]) by mx.google.com with ESMTPSA id lg9sm5268197wjb.3.2014.03.10.02.23.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Mar 2014 02:23:25 -0700 (PDT) Message-ID: <531D848B.2090708@embecosm.com> Date: Mon, 10 Mar 2014 09:23:00 -0000 From: Pierre Langlois User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [PATCH][PR breakpoints/16606] AVR8 breakpoint out of range, decrement pc after break References: <531A2316.5090507@embecosm.com> In-Reply-To: <531A2316.5090507@embecosm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00232.txt.bz2 Hello, I'm terribly sorry, I didn't include a Changelog entry to my previous email. Here it is: 2014-03-10 Pierre Langlois PR breakpoints/16606: * linespec.c (linespec_expression_to_pc): Set TYPE_INSTANCE_FLAG_CODE_SPACE to address given by the expression parser. * avr-tdep.c (avr_integer_to_address): Add TYPE_CODE_SPACE. Best, Pierre On 07/03/14 19:50, Pierre Langlois wrote: > Firstly, this patch fixes issuing breakpoints using an address > expression on AVR. > > For example: > > (gdb) break *0x10e > would result in a breakpoint at the address 0x80010e, out of range. > > AVR is an harvard architecture and we use the top bits of the internal > addresses to determine whether this is a code address or a data > address. In this case, 0x800000 was applied to this address because it > was considered to be a data address. A more detailed explanation of > this behaviour can be found on bugzilla: > https://sourceware.org/bugzilla/show_bug.cgi?id=16606#c1 > > When returning a struct value from the evaluation of *0x10e, nothing > in this value indicates that it resides in code space. In this case > the expression is a linespec, referring to source code, so we can > safely assume the address is in code space. We can set the > TYPE_CODE_SPACE instance flag on the type of the value. When the value > is converted to an address, gdbarch_integer_to_address can apply the > correct mask depending on TYPE_CODE_SPACE. > > This fix unveiled another issue, the program counter was not > decremented after hitting the breakpoint instruction. > This patch fixes this by adding gdbarch_decr_pc_after_break to AVR's > gdbarch. > > Best, > > Pierre >