From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id 2857F3858D20 for ; Mon, 22 Jan 2024 16:29:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2857F3858D20 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 2857F3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::12f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705940985; cv=none; b=Xv022Xy1zuX49wjLeTvgni6mNW8YUxyCReDh/5Z47GBqiUYy2mMRJkFOCJc3AdmLCbmmlkpVPFHbaWwWWqzh8b62UjqyhbaIHunBf9fafBSxQz2WwhAvCV7DVuKpfUvRij19fYaKfqRe7Pvx2nmvoBQTalhoE9cKqAZe5FZuYfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705940985; c=relaxed/simple; bh=BZHhCXZd9kcdyiy21kqImGsSSddqddX7wwRoW4jVGec=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=BA/V2u8smV0F4ZSWPiHvwaQUa4mUJAgsIlphcEg9pc5M3Hq7SNz0AT9Myblek9orjo4wDzXzO2W3IJwl+YaEq0doMctomqYVgzSaWovHM4ssoYByCI3j07SLAlGSOp17DqGF0R9J3RILotPMegFrm1s1vtUh+sio9RJaZaRyyms= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-3627f61fc15so1868025ab.2 for ; Mon, 22 Jan 2024 08:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1705940983; x=1706545783; 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=44FoOIK3oNCDSkCoyqtYNunqIqcEE7oUhlo83EuRNhA=; b=hlFlHe4Bvpxm5mdCEhN2Xz9Fftzu4suUW0HyIjUqYtL1DHYJugyjK+nOKf1CETAB+Q TxjeZPNekodggUTi2td0IzHw3tf5slgBEz6+nYawER6BVTZ9XSed+CdakBgHhYj82m+v 5CCw45J3bxs7IFZJGMDRBnvBwqZ5wSZjxLZjpTOzwl2LWX8ms7IY6sGvIPXb47BEg8iD hbjt1EKu8GfNyaX4gAlITJ5em421+CCvwQS/gjPkn/dd3dDyKLZbK5mpDXgaLGAKW/zV quRnzlVW3FkD8o8R3TXnXJYYkaO3QF4EEuQxT4cWpWLRzcmYm0MfuzVWBhdQ/cdSsOgE TeQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705940983; x=1706545783; 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=44FoOIK3oNCDSkCoyqtYNunqIqcEE7oUhlo83EuRNhA=; b=WtxUyoSMBD3T/scu3asxSxB/YdnK8AcJuMkogElfwtmaIWpr9mU2HCMiUZQz2jOvZd KZgYT8IzyRakME+mi2nT/aiQAQaMzcFy+uoL40jWPrmonB9rbEybte3LKrUoxEcRyohi ZUMbokHTz95hE4kv74mdfXMrk1OriXg551BvSYx0u9aATHYWXHoI6Us4SYXnd8n4UKIr a9vn7tu9cp/CljUZju0rdKpvT8hB6loPeerihsInZlTDgx94acoQG+MdDcA6jQYN5uOo GJle7+s6T9C+2L4YwxsWuy51gdS6sGHSJa+DGONSpSZgFQPG9XhgeEK3IAHMAyJjLItX gCbw== X-Gm-Message-State: AOJu0YzWENbkQdXXg96HiD0nsiYKO6+tXlujqF0dHbt+Vxee6cvkbNI/ 8+cYqbFaTa5u+sxtIZKPUaVASQnLAPzL1085rpVpMaIiqhPLqUjBOXLfzjPtAA== X-Google-Smtp-Source: AGHT+IE1wSh5lfaqsGQyWMXWSlrn3lRzmuLTobxezYEqSVLYhkf//DpEbWbx1bNyKnF+UIHBI6StUQ== X-Received: by 2002:a92:da82:0:b0:361:adb5:959f with SMTP id u2-20020a92da82000000b00361adb5959fmr4975891iln.54.1705940983432; Mon, 22 Jan 2024 08:29:43 -0800 (PST) Received: from murgatroyd (97-122-68-157.hlrn.qwest.net. [97.122.68.157]) by smtp.gmail.com with ESMTPSA id bc8-20020a056e02008800b003606b6d1070sm1103715ilb.22.2024.01.22.08.29.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 08:29:42 -0800 (PST) From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/exp] Fix printing of out of bounds struct members References: <20240122132801.31153-1-tdevries@suse.de> X-Attribution: Tom Date: Mon, 22 Jan 2024 09:29:42 -0700 In-Reply-To: <20240122132801.31153-1-tdevries@suse.de> (Tom de Vries's message of "Mon, 22 Jan 2024 14:28:01 +0100") Message-ID: <87h6j5jpqh.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 de Vries writes: Tom> When building gdb with -O0 -fsanitize=address, and running test-case Tom> gdb.ada/uninitialized_vars.exp, I run into: Tom> ... Thanks for looking into this. Tom> - when y.a happens to be set to 216, as above, gdb interprets this as the Tom> variable having the c+d variant (which is why trying to print y.b fails). One thing I see here is that y.a is not one of the valid values. So I wonder if this kind of corruption should be detected at a different spot, like throwing an exception from compute_variant_fields_inner. Tom> [ Given the description at the top of gdb/value.h of optimized out and Tom> unavailable, I was not sure which one to pick for this case, so this is more Tom> or less a random choice. Yeah, neither seems like precisely the right fit. Tom