From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id V3cnN9WK4mK98RsAWB0awg (envelope-from ) for ; Thu, 28 Jul 2022 09:10:45 -0400 Received: by simark.ca (Postfix, from userid 112) id D2E241E9ED; Thu, 28 Jul 2022 09:10:45 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=HV1Aa91r; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [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 532111E5EA for ; Thu, 28 Jul 2022 09:10:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC56C385AE51 for ; Thu, 28 Jul 2022 13:10:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC56C385AE51 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1659013845; bh=E0wDWQSH4G6mqBfeS3diiwOfRLfsf7XfVSSzNEsRVyY=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=HV1Aa91rTa2sWJP2FHgWyTMa4/4mzpB9bSIn1ih9RkbL6MutsJGO+Mijyb9FMNgiw Sqh/op7iqz3tHFWs0bzqrpAhCbibukCiuDbiOjFfkDNa6lqD7BVkR5xfxbvwhzow+l QW5hCcAYZEVLngyU0trrYg2z/dJUy7VV275d5/9c= Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 355C9385800B for ; Thu, 28 Jul 2022 13:10:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 355C9385800B Received: by mail-pf1-x42e.google.com with SMTP id b133so1897489pfb.6 for ; Thu, 28 Jul 2022 06:10:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=E0wDWQSH4G6mqBfeS3diiwOfRLfsf7XfVSSzNEsRVyY=; b=65nHMLCikZ5c1lSxXboGfQOVDrz4VqhtGkhpAzF6RTvsbbB7ERNTYa8pNAUNWvia/V B6tLX7WMqtsPOw/EDwaDy4VY7P7asTRO6+ROnrtwxzzvFEJJy6zo/IlxZx5xGhPz6wb9 tLYYTIccvkmJpy4IFw6PKG0gj4u65lvna/8sRsYA+4xXxOTLZZqJ50ZMk417Yp8KGbGk Ao19/fUTDwPdGRy8MhHTGezopvnxsFbYADECL1YigocyATU2IC7uxsREaQo6w8uqRgIK VaSA/7bXlsfncPSAFWU5TRvu1eItthDh2BFJ/dOyn75myczfbF+ezqUyfDNoPPUfkXo2 /q7g== X-Gm-Message-State: AJIora/TX4HWLr43XuoNjzftaea2IFU/MpylajEwwndHlUv03pHjRR+s Rt/ryjK/6huD20d9Jo9hEtmY X-Google-Smtp-Source: AGRyM1s2TeF1Qb7DZQp1yAuh4m7G4fWDBEAKqmlA4ScnvnJTLDgMYSJEqFWXO2oSNqvN9P15t1VDFw== X-Received: by 2002:a65:6543:0:b0:41a:dbc1:efc7 with SMTP id a3-20020a656543000000b0041adbc1efc7mr19407510pgw.442.1659013823209; Thu, 28 Jul 2022 06:10:23 -0700 (PDT) Received: from takamaka.home ([184.69.131.86]) by smtp.gmail.com with ESMTPSA id ft18-20020a17090b0f9200b001f2f64eada6sm929874pjb.51.2022.07.28.06.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 06:10:22 -0700 (PDT) Received: by takamaka.home (Postfix, from userid 1000) id C71D3A4AA6; Thu, 28 Jul 2022 06:10:21 -0700 (PDT) Date: Thu, 28 Jul 2022 06:10:21 -0700 To: Tom de Vries Subject: Re: [PATCH][gdb/testsuite] Fix gdb.ada/literals.exp with aarch64 Message-ID: References: <20220727103447.GA9310@delia> <8f343881-a96d-9eef-8cbc-9afc69f97d7d@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f343881-a96d-9eef-8cbc-9afc69f97d7d@suse.de> 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: Joel Brobecker via Gdb-patches Reply-To: Joel Brobecker Cc: Tom Tromey , gdb-patches@sourceware.org, Joel Brobecker Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > > Thanks for the patch. > > > > My question is whether it actually makes sense that -1 be > > a valid output for the print command above. I tried the addition > > of ... > > > > | /* Note: Interprets ULLONG_MAX as -1. */ > > | yylval.typed_val.type = type_long_long (par_state); > > > > ... to a patch of yours: > > > > | commit ac3afe36d73c84096685fece885d70b28bc9629f > > | Author: Tom de Vries > > | Date: Sat Jun 4 13:17:33 2022 +0200 > > | Subject: [gdb/ada] Fix literal truncation > > | > > | Make sure we error out on overflow instead of truncating in all cases. > > | > > | Tested on x86_64-linux, with a build with --enable-targets=all. > > > > Do you remember why we do this? Intuitively, you'd expect that GDB > > would behave the same regardless of whether it selects type "long" > > or "long long" for its processing, as long as both types are 64-bit. > > > > I have no idea. AFAICT it's been in gdb since the "Add base ada language > files" commit from 2002 that we avoid "unsigned long long". > > I've taken care to preserve the behaviour in the commit you refer to (and > this patch), since I don't have the knowledge to decide that things should > be different. > > > With the above, we can take this patch as an intermediate remedy, > > but I think we might need to dig deeper into why we use a signed > > type in the case of long long but not long, particularly when both > > types are the same size. > > > > WDYT? > > > > I'd be happy to write a patch to change the behaviour of gdb. But somebody > knowledgeable in Ada needs to specify what that needs to be. We're really outside of the Ada language. Would you mind checking what the C language does? I think it would make sense to do the same, here. E.g., on x86_64-linux, I get: (gdb) p 0xffffffffffffffff $1 = 18446744073709551615 What do you think, TomT? > > > gdb/testsuite/gdb.ada/literals.exp | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/gdb/testsuite/gdb.ada/literals.exp b/gdb/testsuite/gdb.ada/literals.exp > > > index a6ac89b540f..744a6bc573c 100644 > > > --- a/gdb/testsuite/gdb.ada/literals.exp > > > +++ b/gdb/testsuite/gdb.ada/literals.exp > > > @@ -36,4 +36,4 @@ gdb_test "print 16#f#e1" " = 240" > > > gdb_test "print 16#1#e10" " = 1099511627776" > > > gdb_test "print/x 16#7fffffffffffffff#" " = 0x7fffffffffffffff" > > > -gdb_test "print 16#ffffffffffffffff#" " = -1" > > > +gdb_test "print 16#ffffffffffffffff#" " = (-1|18446744073709551615)" > > -- Joel