From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id BBCCC38930CB for ; Wed, 29 Apr 2020 18:26:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BBCCC38930CB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.193] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3C5FF1F068; Wed, 29 Apr 2020 14:26:17 -0400 (EDT) Subject: Re: [PATCH][PR gdb/18706] Calculate size of array of stubbed type To: Hannes Domani , Gdb-patches References: <20200427114154.2275-1-ssbssa.ref@yahoo.de> <20200427114154.2275-1-ssbssa@yahoo.de> <82e2e5d4-f5e3-7a89-5bcb-bfe305c601e4@simark.ca> <970532437.4157409.1588164436815@mail.yahoo.com> <2135104991.4527821.1588179506131@mail.yahoo.com> From: Simon Marchi Message-ID: <03ddcdaa-4df2-2a08-3de7-4c6b95a44204@simark.ca> Date: Wed, 29 Apr 2020 14:26:16 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <2135104991.4527821.1588179506131@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 29 Apr 2020 18:26:18 -0000 On 2020-04-29 12:58 p.m., Hannes Domani via Gdb-patches wrote: >> For your code to work (and it appears to work, I just want to understand), >> it means that at some point, we changed the target of the array type to >> point to a `struct type` that does have size information.  I'm guessing >> using the information from the other CU.  I'm wondering when/how this happens. > > It happens a few lines above the array stuff: > >   if (TYPE_TARGET_STUB (type)) >     { >       struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type)); > > At this point, the struct has TYPE_STUB set, so check_typedef replaces the > stub with the complete type. Ah I see the lookup_symbol call now, thanks. > OK, I will remove both the TYPE_NFIELDS and TYPE_CODE_RANGE checks. Ok, thanks (although please give it a quick look and make sure you reach the same conclusion as me). Simon