From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 6D7933858D20 for ; Tue, 20 Feb 2024 20:52:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D7933858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6D7933858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::134 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708462335; cv=none; b=Sqfsj2TxYqHkY6v0qdUcSrmyww5SCwpBiTajyI7VLFz8BjMGXfLr00qEYCo1Bn3WBV3DVF/uNQy5yvdwVn0oqYmfSHCTLsnSqyLLGbg7mPhUL8RATNFQ/t63TaMgFdfJCph8xL9MXZDJN3P1vSuJCAJ1NpJA6GImTO1jvywV+RE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708462335; c=relaxed/simple; bh=B3GPO686Zq7z8TklQQhSbdxEugFGAwoR8yMG3cri6Nc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=FcsNBLtr6CoCaQD3wFT1Junl0qi1d1bkTKqtm/mwQnDaFgXdLc4dt7gNumc+NPXC43FluNSZeGsczlARuAnC2k4IQnC0a7CH4JHe4laSnVs6nqjVBRhMnneZDrUix3C0Tee3Tlzx6WYRRKp34mGu3fpsLjO9RDHGVCWfiRX8V5c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-36423c819a3so24318645ab.0 for ; Tue, 20 Feb 2024 12:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1708462332; x=1709067132; darn=sourceware.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=SvnqUGF3johsUK2DygUenD/0lWvkAQ/pgBkxd/TCZZg=; b=PmoXiCRQwnVEdZLdlOWB6dmNJl3MDfKgVkLR/pCbPQPjfSyrXTAj4Wt84DZI2YpIAS klr8KXV55bKhZlitnSvIX+CAu6qWATmNE5yZz+rnPjrkSRrt6VKALp5gBinQ691dP74j ioJxJnpKI6vhGCwdAZzz5W1ODqrkKhVaQP3hKyfW61/WninzK0FN3YXuUPZXX/4Rmzfo JqrkBoVldGA14Ov/DpRn3eLYZ2bdLhWYTKnsn/tuSdW3SK4oRFnfsiis8jYA+Qpqos5g W/jB4mYMb6L7x94TKnBddFM+JO8GGstKfoPlj4oUK/9WFoVLGmtLEubtayu42l4oR5e5 pOQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708462332; x=1709067132; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SvnqUGF3johsUK2DygUenD/0lWvkAQ/pgBkxd/TCZZg=; b=MOmpKJCRF1uPHbiS7VH0mGXasKjrH3xYrIVVvHfjBt2jRcYKsfrnxkW9m5r+dGs/FP ipy8atZB8hzjPsn2IHwveQ/Q9XkpUQIWHkjbqxLXx+ovQwAJngtflj0LO/yqMKjHXGzQ PJA6zXZmeEwM2kfp2WdJ+EQOw1iH9OWW/ePIFTQ/lWNs5BLBrvkNMTeyDS+l4EcIHVfK G0J5m4wgTBbx6AOnhBw9WizCDT3//AjROxkA0U7hNGay6d8brXhxmTalrQOzO47YISgY LvNcRa/34FpVoZlkOrjiaVJfHB0IuWe+1bnPvZxxDz/n4GH/cSwJDc9jtaByYrgu+rH5 6yKw== X-Gm-Message-State: AOJu0Yybs67aVYZba8ahtZtLzrn19RGIxsSWUgP5pj1RIf4xaE/f9mfB RofLDC1mNPQHseUjpu9ZiKd1QwUtKkVe2eMKuYQax8Nrj8kYFx24MJ9MEbpqkzQzhTCQhOfmT1w = X-Google-Smtp-Source: AGHT+IH9Y8zvruWL8eOhtwGsKumE3eEv5josvqPrai08arizBM0f1ju0upfumruArHc5lJhsUK9R8g== X-Received: by 2002:a05:6e02:1d18:b0:365:105d:e0b5 with SMTP id i24-20020a056e021d1800b00365105de0b5mr15101795ila.8.1708462332619; Tue, 20 Feb 2024 12:52:12 -0800 (PST) Received: from murgatroyd (71-211-170-195.hlrn.qwest.net. [71.211.170.195]) by smtp.gmail.com with ESMTPSA id g25-20020a02cd19000000b0047441e598eesm56643jaq.51.2024.02.20.12.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 12:52:12 -0800 (PST) From: Tom Tromey To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Rewrite Rust slice type handling References: <20240202182017.1731887-1-tromey@adacore.com> X-Attribution: Tom Date: Tue, 20 Feb 2024 13:52:11 -0700 In-Reply-To: <20240202182017.1731887-1-tromey@adacore.com> (Tom Tromey's message of "Fri, 2 Feb 2024 11:20:17 -0700") Message-ID: <87o7ca270k.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,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: >>>>> "Tom" == Tom Tromey writes: Tom> This patch rewrites the handling of slice types in Rust. Tom> More recent versions of the Rust compiler changed how unsized types Tom> were emitted, letting gdb inspect them more nicely. However, gdb did Tom> not do this, and in fact treated all such types as if they were slices Tom> of arrays, which is incorrect. Tom> This patch rewrites this handling and removes the restriction that Tom> unsized types must be array slices. I've added a comment explaining Tom> how unsized types are represented to rust-lang.c as well. Tom> I looked into a different approach, namely changing the DWARF reader Tom> to fix up slice types to have a dynamic type. However, the approach Tom> taken here turned out to be simpler. Tom> Tested on x86-64 Fedora 38 with a variety of Rust compiler versions. I'm checking this in now. Tom