From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14764 invoked by alias); 15 Oct 2014 13:43:10 -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 14752 invoked by uid 89); 15 Oct 2014 13:43:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-oi0-f48.google.com Received: from mail-oi0-f48.google.com (HELO mail-oi0-f48.google.com) (209.85.218.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 15 Oct 2014 13:43:08 +0000 Received: by mail-oi0-f48.google.com with SMTP id g201so939727oib.35 for ; Wed, 15 Oct 2014 06:43:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=+DSgu4lyQrQHKXynelLdFc2ZL6ZgErEW9qPoJxDSGmQ=; b=Y7FFFZcByt2E0vbefPMrNfoVh+Xk9nEWWOsFaEXH/9B0UFPWRXGDMzGVW8VYjfQTNW q4OUnah5zxajzw+SwNKRr7+woc58XYW3bxsd6zLgForN4LHKk+kV1Jp1al6ES4WGYmaz NLRTjzqqRRLLgXXfXkgWQj7EkX3NkZJ+b/9PT5dIx17Da63RhyDN3xnDj3rNq46rO+6I pPZF943Vv34SZMJCq2eghY1oo2/MtYajapTDHJnd6aoFjN6JJ74IOoeIzG6Fb8xnhufy YDOkpIFMPCdk1gkemdPo9+B0rPeKfN0DTMI17vpszMyvQmatHrjLR4ewXhFoegCt6jAv gwzw== X-Gm-Message-State: ALoCoQnlGj8VXy4w0Ipna0HXzy3YylDAk0gD77oYnkj6C1GwNysBAkdwkpjedp/zjwuVxR6LhuVz MIME-Version: 1.0 X-Received: by 10.202.106.145 with SMTP id f139mr10114709oic.43.1413380586286; Wed, 15 Oct 2014 06:43:06 -0700 (PDT) Received: by 10.202.197.13 with HTTP; Wed, 15 Oct 2014 06:43:06 -0700 (PDT) In-Reply-To: References: Date: Wed, 15 Oct 2014 13:43:00 -0000 Message-ID: Subject: Re: [PATCH 0/2] Make chained function calls in expressions work From: Siva Chandra To: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00391.txt.bz2 On Wed, Oct 8, 2014 at 5:02 PM, Siva Chandra wrote: > On Tue, Sep 30, 2014 at 5:42 PM, Siva Chandra wrote: >> On Fri, Sep 26, 2014 at 6:29 AM, Siva Chandra wrote: >>> This patch series enables having chained function calls in >>> expressions. An example of a chained function call is shown in PR >>> c++/11606. It has an example of a chain of two function calls. This >>> patch series enables chains of any number of function calls. >>> >>> Currently, an inferior function call is handled via >>> call_function_by_hand. The value returned by the inferior function is >>> copied into a GDB value whose lval_type is not_lval. Its contents are >>> stored within the value irrespective of whether the return value is in >>> inferior memory or in a register. Consequently, any subsequent >>> function call in the expression which requires this value's address as >>> an argument throws an error as the value is not in inferior memory. >>> >>> This patch series keeps most of the current flow intact, except that >>> the value returned by the inferior function is made to be a new >>> lval_type called lval_mirrored_on_inferior_stack. These values have a >>> mirrored value of lval_type lval_memory which reside on the inferior >>> stack. They reside on the stack only for the duration for which the >>> expression is evaluated. This enables value_address to return the >>> address of the stack mirror instead of throwing an error. >>> >>> Patch 1/2 - Adds new lval_type named lval_mirrored_on_inferior_stack. >>> Also adds support for values with this lval_type. >>> Patch 2/2 - Enables chained function calls by mirroring values >>> returned by inferior functions in the inferior stack. >>> >>> Patch 2/2 only targets values returned by call_function_by_hand. I >>> think similar things can done for call_internal_function and >>> call_xmethod. I will extend the idea to these functions as well after >>> this patch series is approved (if at all). >> >> I used global state in patch 2/2. I thought eliminating that would not >> be a straightforward task. However, I spent time looking into it and >> it turned out to be much simpler than I had anticipated. I have now >> updated both 1/2 and 2/2 to not use any global state. I have also >> regression tested and found that a known failure now passes. Will >> follow up with v2 of 1/2 and 2/2 both. > > Ping. Links to the other patches in this series: > > https://sourceware.org/ml/gdb-patches/2014-10/msg00001.html > https://sourceware.org/ml/gdb-patches/2014-10/msg00002.html Ping.