From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 446EC3858D37 for ; Thu, 30 Nov 2023 14:05:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 446EC3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 446EC3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701353148; cv=none; b=RR7yJUU/f3vQQsk473tVtOE1YPLn9EjHi7kNo+922jA4vIPoB8TZlABR1st0h3kfe2hn17Q1viXDIlpLvcf3POYk1rRtZmj3tt28ZsZdam4s1BZYV8lE5OPJrbTZHh2vvAB0sZskBKOiedFXbaEIT6nNZGGdWldqplJ/bh/opoc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701353148; c=relaxed/simple; bh=OtZNud19Kqu0H3i1j4Vze9shpNu4bXxfd+12i2vTKMw=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=BES+2QqYVaMYvXs9UUAX6alxrm7rowWtDKRnKJWsfQUnyoAScp8GlIfEnmHWAxq4oR5t5eTbHYlSwZGmfblNooCNj+gyJXpHftsTgnqKg++6+fg/S36yhhC63J5PAb2Adnrdr8shmHrrlQHz1nJXf2vBYVZXhAEkDmv+8lN92jQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E61991FCEC; Thu, 30 Nov 2023 14:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1701353142; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MZErU0e8r0q6gxdl7LRDMoQs4v+yFZLqQpVhLTvTCss=; b=stwVbLoCx3d4yYtu39BgREY3GklU7AjQ0Y8aaPhmu4HxDT+fs97t89JV6jDdDXLmyO4Qfp Btr9KSqJfLhLRSMom+ebnoEa2U0grjIMtWAdwy+W1cPhPMlTOgSx55GMmxhjEpoICZnmiC Ak3LGja0HhqLIYKRczMXwZa+vMHS4dQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1701353142; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MZErU0e8r0q6gxdl7LRDMoQs4v+yFZLqQpVhLTvTCss=; b=jO6vB9GN7VKDMH8GAdfKV9MdsvO65qfO4aU2A9Gbi0SjUfhE5JFpKjIvmg3kWn94VX7Het GbhJEdTeMVKldqCw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CEEEF13AB1; Thu, 30 Nov 2023 14:05:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id nCQgMbaWaGXwSQAAD6G6ig (envelope-from ); Thu, 30 Nov 2023 14:05:42 +0000 Message-ID: <257b4ed5-b1fb-4a08-8d00-b4a7f9015c99@suse.de> Date: Thu, 30 Nov 2023 15:05:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 02/13] [gdb/symtab] Check effect in parent_map::set_parent Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20231002125051.29911-1-tdevries@suse.de> <20231002125051.29911-3-tdevries@suse.de> <87y1fxnkd7.fsf@tromey.com> From: Tom de Vries In-Reply-To: <87y1fxnkd7.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -1.40 X-Spamd-Result: default: False [-1.40 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-0.31)[75.27%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-0.999]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/20/23 21:51, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> Set_parent uses m_die_range_map.set_empty to set the parent of a range. > Tom> If part of the range is already set, it remains the same. > > Tom> If the entire range is already set, the set_empty has no effect, silently. > > Tom> Fix this by verifying that calling set_empty has the desired effect on the > Tom> start and end points of the range. > > This seems like it might be better as a unit test. We're trying to check the uses of set_parent, not the implementation, so a unit test doesn't help there. Consider the following sequence: - set_parent (3, 6, b) - set_parent (1, 10, a) Now the parent map looks like: - [1-2] : a - [3-6] : b - [7-10]: a Now say we accidentally execute this in the opposite order: - set_parent (1, 10, a) - set_parent (3, 6, b) Now the parent map looks like this instead: - [1-10]: a The second set_parent has no effect, and this happens silently. The assert tries to make this mistake visible. It could be fitting to add some kind of gdb_checking_assert scheme for this, which is off by default in releases, and can be switched on by some means, if this is considered too expensive. Anyway, since it raises questions, I'll drop this patch for now, but I'd like to note that it was useful for me in development of this patch series. Thanks, - Tom