From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id bDaHNu55A2uB0C0AWB0awg (envelope-from ) for ; Sun, 22 Nov 2026 18:25:34 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XbU5Itci; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C92231E167; Sun, 22 Nov 2026 18:25:34 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 64EE81E023 for ; Sun, 22 Nov 2026 18:25:34 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 031654792A50 for ; Sun, 22 Nov 2026 23:25:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 031654792A50 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XbU5Itci Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id E15104BCA411 for ; Sun, 22 Nov 2026 23:25:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E15104BCA411 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E15104BCA411 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795389909; cv=none; b=PeaIDesHsXVs8c4ASDd3YEWnu9RxRIZ1FehGSkUXqs2gTdeJTnvD3a/a6BoaDbKrIidk8JKDV6lFOjK22pLyhzMs6yqLWf+9oQ0jiPJF9wtezHml6OY7b2aN0P40O6p8jMpK/AjhfAIRXXL7POAxaTMin62FdkHh3ddhrWELiao= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795389909; c=relaxed/simple; bh=8+qIyCWcJR4HKpD5nwrc1QLfEz9dtRCuz6e7snTpXko=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lwaS7L+xY4Z5cj9EwKA7r9IVezgVhYkqEoOhsNmcNRnK1DVUstF1x2DeuY1kTi7gMdKVOBI9hPIfUvQkY9ukbsVlXKbgogdUI70PCZWfjT1cVCyOCdjW5pKnNWWMlZCYH87Vm1+rOqfZwJafcG65jruWagnvs8NF8wLL/Hq14u8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XbU5Itci DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E15104BCA411 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795389908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W5Uq3/so0CLKi3REt32ZObemGXJ2gO8rVR6rFaFT/no=; b=XbU5Itci/kgkWU6ByIjIcJ8s8KpVOSNnn36E0NutXCLkiweYe01kNCDxCoPU5Q7xYeD2TO JJWIDsJhaumA8KKLwKhMPfFAfd+LF4H2TQDP3+b/mYs6zwwG5Yt8l9kFcyPtl84q7Kz89D m8JPKWtb6LcnJkR5zVBbYSp6Ne5J0fs= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-8jZ4wbgoNF6ug33Mvy_SXA-1; Sun, 22 Nov 2026 23:25:06 +0000 X-MC-Unique: 8jZ4wbgoNF6ug33Mvy_SXA-1 X-Mimecast-MFC-AGG-ID: 8jZ4wbgoNF6ug33Mvy_SXA_1795389905 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-49034831bb3so1617885f8f.1 for ; Sun, 22 Nov 2026 15:25:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795389905; x=1795994705; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=W5Uq3/so0CLKi3REt32ZObemGXJ2gO8rVR6rFaFT/no=; b=K1F4LWfZPyg6eVyNEiFmSWDKgSC6iDfrFVbeSt+tq0k4Ou1FbW0azbJvUSrdT9Y9tK BL9qceNGh7HpfNyQJ7AruCGxTGqSy/99zMZvdIji75y6Al6qkZTh1Eqj5bo0SNWk3E2D r+Q1THZXd3RkLRfEaim5LsHXnNoEeY9lAf20SYjnJk7zeBgtaacrXnUjb/pj4JNp1O6u DUwDVkw/Q1ef28i6hbJpB5aadACAPgGxGyRdZdtMQaFFwmGP5yzuadYcSpVkMIPtu8eF Y8cSwExqfryZrOpX19WCD7nArObtFASj2rMyjz6OUgAkN7NQvP5k0/UO3jU9cDCetsv5 6CkA== X-Forwarded-Encrypted: i=1; AL+hErHsomxJnrxr+YipbI1f0miBqHKwmKfst7SFNYaIn/mC5zfJD9uMq9fuOs9DPI9FTignfbuzZRMVOPexzw==@sourceware.org X-Gm-Message-State: APuU4Z9HKhtQbfR61zcxWVXxK9H3Y1ZPjmIxDMRnMd3D/qNwcWIUMkN2 VM9J9kBU2Eg0SXMx8TAw3glX3IHdOKgoKgan3ASrGOe3+kUKVVirZ6MHGq+g6Vs3WQCVjkkAk+n Yn2rCTwvo5WDK6HP4wQ06EUyHAeG4LiuaxyWPw3KkUxVia4z4Vzi0Pr0aHH2PMlPfUaUWjg0= X-Gm-Gg: AZFdTZfTn1AW//KGZp0G8JpUguAP1yJZ6gnXqsj+qrB+IJfp0nKLCPraDSJPURijPmZ HHnGcekysOql3GkneatyBMO8fFWks7Gz/zIDYKeXOgFeSUnNcUpMCbEksYRwdzNCQjf7bj0hLx6 uxeLrpgBK9u0sqB8PhBiMQnfwKSfjZuE1bc+OgPQg6YlGi81xh0KASpddosiIxy68dEwuH/6h5S DrUloOLglye4MtSw3irUy/erE7jSWBBfOxMhVzXOX3D4CE5egsgTidby/Mz6h/rMQJy9J8MWVU2 nViIYOxGnfJ79ESqWjCtEyw/h5+Cmx8wYsFgkrGgAajXNG9woRwkrSbnEJ3RHCHTsDiCzEu5A2d 58dAh55rDMzXhCIw6FqAcZ9PZcs9YvVbNb9nBi4OIgSzrOA== X-Received: by 2002:a05:6000:40ca:b0:4a3:976e:27a2 with SMTP id ffacd0b85a97d-4abb5146238mr18699080f8f.34.1795389905120; Sun, 22 Nov 2026 15:25:05 -0800 (PST) X-Received: by 2002:a05:6000:40ca:b0:4a3:976e:27a2 with SMTP id ffacd0b85a97d-4abb5146238mr18699055f8f.34.1795389904712; Sun, 22 Nov 2026 15:25:04 -0800 (PST) Received: from localhost ([83.216.138.189]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ad644140b5sm15459202f8f.17.2026.11.22.15.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2026 15:25:03 -0800 (PST) From: Andrew Burgess To: Tom Tromey Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Make gdb::span handle nullptr like std::span In-Reply-To: <87qzgcre6n.fsf@tromey.com> References: <20261122054124.3738131-1-tom@tromey.com> <87qzgcre6n.fsf@tromey.com> Date: Sun, 22 Nov 2026 23:25:02 +0000 Message-ID: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: dMi4i3CSaRSu8cEn0hRHkLEdS2oDRvkk1JtfzjZEJSc_1795389905 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Tom Tromey writes: >>>>>> "Andrew" == Andrew Burgess writes: > > Andrew> I don't see any benefit of wrapping these in _GLIBCXX_DEBUG. Sure it > Andrew> means we match the std::span behaviour, but all that really means is > Andrew> that we fail to spot undefined behaviour, which isn't a good thing. > > Andrew> I'd prefer these were just unwrapped gdb_assert(...) calls. > > Andrew> But if you feel strongly about it then I'm not trying to block this fix. > > I only did it because it's what is already done in the file, and because > in the past we've had discussions about how certain asserts slow things > down. Yeah, I think that's why we cannot just set _GLIBCXX_DEBUG on for all GDB builds (in the same way that standard gdb_asserts are on for all GDB builds). But I think these particular asserts are not going to have a massive performance hit. > > I don't mind removing the #ifs at all. Meh, as you requested, I just pushed my patches, which includes a similar assert in gdb::make_span, which is an unguarded gdb_assert, so we will catch some of these anyway, whether using the old gdb::span or std::span. I'd drop the #ifs, but I don't feel that strongly about it :) > > Andrew> I think you should just go ahead and merge your patch: > > Actually I think you should push yours & I will rebase on top of those. Done. Thanks for your feedback. Andrew