From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13080 invoked by alias); 26 Nov 2014 05:19:54 -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 13069 invoked by uid 89); 26 Nov 2014 05:19:54 -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-vc0-f169.google.com Received: from mail-vc0-f169.google.com (HELO mail-vc0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 26 Nov 2014 05:19:53 +0000 Received: by mail-vc0-f169.google.com with SMTP id hy10so987150vcb.0 for ; Tue, 25 Nov 2014 21:19:51 -0800 (PST) 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:cc:content-type; bh=B9tZgIayPt6ROrJ39jcHOtnkKrfROU0/auxozYvo7kI=; b=d/T2tn8/VOYB39hPB1dnfoEycMK3Lix14QD5n+gDpoQlFRhnBTAuc+cM6bc5GqxnMx wKsKXoYwGaTX9LrAfTTi6vRzXXhC4kpJs0L98mJF9MhO091FDTeG1j5hgy5wM4xHjxEJ 4fU9x1USsVrwzSLqSS3hRw87t7kKT2G70KOoJxSeHb5upbAFAWVXO3Gq/0P6E4b+L706 bFc7Xf3E/zUYwtRowhXGq3MiaEoIIYn5PFmn3GkUDNf3GvYzjt93l9zzeddBKa62B7hB u/iTDimbkmUwnt8X7mr0eV1l6Es6M4isJQvODfjCYCTUz15z4Xy+E8yuVKVDBbl1onnT /i7A== X-Gm-Message-State: ALoCoQk4BlArV0fYGpM8FU9xIJrJh8E0tplWi8h/70COTL5tawyumLvlThvh2bnJRFosc10EQlfg MIME-Version: 1.0 X-Received: by 10.52.28.7 with SMTP id x7mr14359738vdg.27.1416979190963; Tue, 25 Nov 2014 21:19:50 -0800 (PST) Received: by 10.52.114.101 with HTTP; Tue, 25 Nov 2014 21:19:50 -0800 (PST) In-Reply-To: References: Date: Wed, 26 Nov 2014 05:19:00 -0000 Message-ID: Subject: Re: [RFC] While processing a struct die, store the method's address in its fn_field From: Doug Evans To: Siva Chandra Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00649.txt.bz2 On Tue, Nov 25, 2014 at 7:58 PM, Siva Chandra wrote: > I will go over your comments in detail and respond. One clarification > until then ... > > On Tue, Nov 25, 2014 at 7:22 PM, Doug Evans wrote: >> btw, when I try your patch I get one fail: >> >> p lambda(10)^M >> Invalid data type for function to be called.^M >> (gdb) FAIL: gdb.dwarf2/dw2-member-function-addr.exp: p lambda() > > As mentioned in my very first email, the tests depend on > https://sourceware.org/ml/gdb-patches/2014-11/msg00479.html. We can > remove this dependency by invoking the operator() explicitly > "lambda.operator()(10)". Ah righto. Digging a bit deeper, I see the lookup_symbol call in value_fn_field gets passed NULL for block. That means that lookup_local_symbol won't do anything, but what we're looking for (as can be seen in the symbol dump) is not in STATIC_BLOCK (block #001) nor GLOBAL_BLOCK (block #000). If I manually hack the value passed to lookup_symbol to be a block with __lambda0::operator()(int) const, and disable your patch, then "p lambda(5)" works. So I think we need to figure out how to pass a usable value for block to lookup_symbol in value_fn_field. Also, I wouldn't preclude a gcc bug here and/or a bug in dwarf2read.c where the lambda should have been in a different block than the one it was put in.