From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uKBmGG96qV+TcQAAWB0awg (envelope-from ) for ; Mon, 09 Nov 2020 12:20:47 -0500 Received: by simark.ca (Postfix, from userid 112) id 61D1A1F08B; Mon, 9 Nov 2020 12:20:47 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BB3CA1E552 for ; Mon, 9 Nov 2020 12:20:46 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 75E9C3896C25; Mon, 9 Nov 2020 17:20:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75E9C3896C25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1604942446; bh=llb2mD+bPe0gyJu3LGLTI5ndp2on4gADD/T9pCq0O/Q=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=lINErNwDD+9JbwMSXmhgPN66wUdlK6i5WXAtB7TCr5LbCv2N4D3Z7jBO1rg9Swyjq MDw6bKUXco9r8cLa9pqu6DbQs7a4iCfxSYmfSDYlhBHecR2I9HM3feQ1kJ3AhOPM3j 7eYelgwR6pZlwMazQH+6D0shztFuVKXmIu8zFqNA= Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by sourceware.org (Postfix) with ESMTPS id 003AC3896C29 for ; Mon, 9 Nov 2020 17:20:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 003AC3896C29 Received: by mail-qt1-x841.google.com with SMTP id 7so2135419qtp.1 for ; Mon, 09 Nov 2020 09:20:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=llb2mD+bPe0gyJu3LGLTI5ndp2on4gADD/T9pCq0O/Q=; b=oMsklhJo/j2YjcR21MN8AXC8WyrChgL2PtoIkuT2XogZTiVtCsuDENrDA7I/f0Myms +DcqS58RKf2VxX770deaYDW7cxMDri15m1CzOFbYrPhzHKgAoELqMuR4ITZqfYx1uil/ hJwX2EUizPsgvxTLwQRbJa0gGn85DM8lmAaokS1Z4u7Vtob8dXAX6PacTCtk5O7I46WS jp4sL/nLc3k+Nl9bal1I5YWCIf31z7CVvDC+WZ+3MTr+tXLF+k7Xgmfz3tkB6radJblR dvPo9fHbkhZnAtDq6ZQ3pIN6rjr94rvR6OVa3+NRpAvK90W9JKgjWHmyYkON7ZNlw6Hb NRJA== X-Gm-Message-State: AOAM532FmufSvZLdaKW/5WBPjNUCEGcpfZq9S/2Dj67POKjiT/NHKDry bkYFTg1/NrIBhjjvxcWPvcdAFA== X-Google-Smtp-Source: ABdhPJyt7SiZgGavsIfQrqgVpt4Wt8z2PuHaHNwlCso6SCJZ80ycciNKORH6ssCcIQlnjCHdok0g6A== X-Received: by 2002:aed:3c42:: with SMTP id u2mr2192932qte.159.1604942443632; Mon, 09 Nov 2020 09:20:43 -0800 (PST) Received: from ?IPv6:2804:7f0:8284:1487:519e:783a:4fff:26b3? ([2804:7f0:8284:1487:519e:783a:4fff:26b3]) by smtp.gmail.com with ESMTPSA id x4sm6467285qtm.48.2020.11.09.09.20.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Nov 2020 09:20:42 -0800 (PST) Subject: Re: [PATCH v3 21/24] Extend "x" and "print" commands to support memory tagging To: Eli Zaretskii References: <20201109170435.15766-1-luis.machado@linaro.org> <20201109170435.15766-22-luis.machado@linaro.org> <83d00m4fld.fsf@gnu.org> Message-ID: Date: Mon, 9 Nov 2020 14:20:40 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <83d00m4fld.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Cc: david.spickett@linaro.org, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 11/9/20 2:14 PM, Eli Zaretskii wrote: >> Date: Mon, 9 Nov 2020 14:04:32 -0300 >> From: Luis Machado via Gdb-patches >> Cc: david.spickett@linaro.org >> >> Suppose we have a pointer "p" with value 0x1234 (logical tag 0x0) and that we >> have an allocation tag of 0x1 for that particular area of memory. This is the >> expected output: >> >> (gdb) p/x p >> Logical tag (0x0) does not match the allocation tag (0x1). >> $1 = 0x1234 > > If the tags did match, GDB would have also printed the contents of the > memory pointed to by p, right? At least with pointer to 'char *' > strings it would. Does GDB still print the contents if the tags don't > match? If it doesn't, it should say something like "Cannot access > memory at NNNN: logical tag doesn't match". > Yes. GDB should print the contents just like before. I don't think we should prevent the debugger from printing the pointer/contents even if there is a tag mismatch. The tag mismatch part is a warning so users know that something is off (and may cause memory faults).