From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1759 invoked by alias); 5 Dec 2013 13:04:40 -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 1749 invoked by uid 89); 5 Dec 2013 13:04:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Dec 2013 13:04:39 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB5D4WCj027877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 5 Dec 2013 08:04:32 -0500 Received: from [127.0.0.1] (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 rB5D4Tad005065; Thu, 5 Dec 2013 08:04:30 -0500 Message-ID: <52A079DD.5050101@redhat.com> Date: Thu, 05 Dec 2013 13:04:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Sergio Durigan Junior CC: GDB Patches Subject: Re: [PATCH] Use "get_current_arch" instead of "get_objfile_arch" on SystemTap SDT code (and fix ARM bug) References: <1386225226-18549-1-git-send-email-sergiodj@redhat.com> In-Reply-To: <1386225226-18549-1-git-send-email-sergiodj@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00181.txt.bz2 On 12/05/2013 06:33 AM, Sergio Durigan Junior wrote: > While implementing another patch and testing things on ARM, I found a > strange bug (at least initially). There was an expression on some > probe's argument that did a displacement of the "fp" register (i.e., > "[fp, #-8]"). However, during the evaluation of the parsed expression > GDB got confused and could not access the "fp" register due to an > invalid address being returned. Adding get_current_arch calls outside initial command evaluation raises eyebrows. /* Return "current" architecture. If the target is running, this is the architecture of the selected frame. Otherwise, the "current" architecture defaults to the target architecture. This function should normally be called solely by the command interpreter routines to determine the architecture to execute a command in. */ extern struct gdbarch *get_current_arch (void); struct value * probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n) { ... return evaluate_probe_argument (probe, n); } FRAME here is the context the probe is being evaluated in (get_current_frame(), the frame/thread that hit the event, passed from infrun.) It'd be better to use the frame's arch explicitly (that is, pass down the frame or arch to evaluate_probe_argument). -- Pedro Alves