From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MENNOjKixGJm0gwAWB0awg (envelope-from ) for ; Tue, 05 Jul 2022 16:42:26 -0400 Received: by simark.ca (Postfix, from userid 112) id E977A1E22D; Tue, 5 Jul 2022 16:42:26 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Wd6YEp5C; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8A8301E220 for ; Tue, 5 Jul 2022 16:42:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1AA4B385AE5C for ; Tue, 5 Jul 2022 20:42:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AA4B385AE5C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1657053745; bh=CS0mkaUNa/7SsHx9Uv8mked/Fy9zLMjSgxfY9rp2aLg=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Wd6YEp5CzMuBSTkjiV9onfc8q0vjzKI+WtyVGEf0xZQXCFR3Dwo2fxFns7E9tpXef rrC+wVV53/dIPzzroMUPbPPKsbKE4KPRZ1e30Uf9UcjDOhnH1Q02xZ23qJXmyLPjj2 z9X+81FJuSz2ilXZPgOEaNHePiHHOAt+GKrtHsMQ= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 6780D3857BAD for ; Tue, 5 Jul 2022 20:42:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6780D3857BAD Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7079B20590; Tue, 5 Jul 2022 20:42:06 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5C45E1339A; Tue, 5 Jul 2022 20:42:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id cgEpFR6ixGLmCgAAMHmgww (envelope-from ); Tue, 05 Jul 2022 20:42:06 +0000 Message-ID: <1dce1ba8-6f29-1ddc-ca83-720722a7c3ca@suse.de> Date: Tue, 5 Jul 2022 22:42:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH][gdb/exp] Fix internal error when printing C++ pointer-to-member Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20220630145930.GA20127@delia.home> <87fsjfv1l4.fsf@tromey.com> In-Reply-To: <87fsjfv1l4.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 7/5/22 20:47, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> (gdb) print ptm^M > Tom> $1 = gdb/gdbtypes.h:695: internal-error: loc_bitpos: \ > Tom> Assertion `m_loc_kind == FIELD_LOC_KIND_BITPOS' failed.^M > Tom> ... > Tom> while printing a c++ pointer-to-member. > > Is this crashing due to the static field? > Yes. > Tom> Fix this by skipping fields with m_loc_kind != FIELD_LOC_KIND_BITPOS in > Tom> cp_find_class_member, such that we have: > Tom> ... > Tom> (gdb) print ptm^M > Tom> $1 = &A::i^M > Tom> ... > > If so then I think it's better to skip when the field is static, not > based on the loc_kind. Ack, committed using field_is_static instead. Thanks, - Tom