From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 9AADF3858C78 for ; Fri, 17 Feb 2023 10:19:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9AADF3858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676629184; 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=kgIwU7tZ+uv6UwuvuSI6fwgSkb8Od6x042d9RZTBQew=; b=jWOOG0TM4A+XcdE82uk2/uXfnfaPk+7dZCvWz/DiyErcn+uLRgC+EEzEFS/oRbcDD6QOWU 5vycO2lbOx39ISpy0jnwLDXaVw63hJjHYW6a//Bdp+1b8DWZ8KS/Z9yOqK+8LOYChtRhUb +lXkoNewrMSj9KnFvv8ickdWXGd2jQ0= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-304-C73g8VsmO0O3EOHSq5CoaA-1; Fri, 17 Feb 2023 05:19:43 -0500 X-MC-Unique: C73g8VsmO0O3EOHSq5CoaA-1 Received: by mail-wr1-f71.google.com with SMTP id co22-20020a0560000a1600b002c5400f5c76so48002wrb.14 for ; Fri, 17 Feb 2023 02:19:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kgIwU7tZ+uv6UwuvuSI6fwgSkb8Od6x042d9RZTBQew=; b=Y4/SjgeCYDONwe2Eoe8Fm1+OSGGLPVb/Z5sXzreufKrSzx3nH4EQnWeRxmo+yV1zeP 3vHNwdBslCIjVAv6UdgZ9UuIFQJx2n/g4p07LsrQSg3AXmrAcDxwLPshNlfn1j2vwLOn C1hnmgFRiiaQ89831KrwBDXxey4xMvrHPkHO2SQ4bxsZvoaOGAgq6od/LTtTpX5i3kan qYqP0odyLex9oGcVPFWQYtvoDIyvtOP86k7lH14buN5FnaT7I50/vwsZaHWDqFX6h6t7 a5CkctkVnTP97NNTwxHDHc02oNgqRAacdXQrTym4ZuXRu6mp5LETQI8E3fuMP2rG93KE 7fUw== X-Gm-Message-State: AO0yUKUCB9X8jRlaza94flj9gxkhswOTOHm6PoB12254kOA0ZnUgviw0 qu6N2WcibEkKI75e9cfY/TjgkZwgEKhNE9e19B8M7sNeGsEt2D0SQtlM745FrT5G0+cprDlNjM1 reabNYycoVJybvWpWNxHDOOrqc2c= X-Received: by 2002:adf:fc88:0:b0:2c5:7c7a:78fb with SMTP id g8-20020adffc88000000b002c57c7a78fbmr4769228wrr.40.1676629181849; Fri, 17 Feb 2023 02:19:41 -0800 (PST) X-Google-Smtp-Source: AK7set88JFeBpCLaG3n3/KPbQyRzsJwTA/c0OR0FOR2sxY+awpX9bFUYNlGkkca/oyIPGmRT4WnURg== X-Received: by 2002:adf:fc88:0:b0:2c5:7c7a:78fb with SMTP id g8-20020adffc88000000b002c57c7a78fbmr4769218wrr.40.1676629181508; Fri, 17 Feb 2023 02:19:41 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id r12-20020adff10c000000b002c54c92e125sm3801914wro.46.2023.02.17.02.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:19:41 -0800 (PST) From: Andrew Burgess To: Tom Tromey , Simon Marchi Cc: Tom Tromey , Tom Tromey via Gdb-patches Subject: Re: [PATCH] Do not record a rejected target description In-Reply-To: <87zg9do1s6.fsf@tromey.com> References: <20230112193356.1133696-1-tromey@adacore.com> <87bklwmenh.fsf@redhat.com> <875yc4tawn.fsf@tromey.com> <875yc3m6in.fsf@redhat.com> <871qmqsyvu.fsf@tromey.com> <87zg9do1s6.fsf@tromey.com> Date: Fri, 17 Feb 2023 10:19:40 +0000 Message-ID: <87o7pslhkz.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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 Tromey writes: > Simon> I see: > > Simon> maint print c-tdesc^M > Simon> There is no target description to print.^M > Simon> (gdb) FAIL: gdb.xml/maint_print_struct.exp: printing tdesc with a structure and a bitfield > > Here's a patch that avoids this problem. > Let me know what you think. > > Tom > > commit a12897d22ccc1d927960fa411b99723d76620af0 > Author: Tom Tromey > Date: Thu Feb 16 12:17:50 2023 -0700 > > Fix regression in maint_print_struct.exp > > An earlier patch of mine caused a regression in > maint_print_struct.exp. This patch fixes it by modifying the test so > that it does not rely on the erroneous target description being > available. > > diff --git a/gdb/testsuite/gdb.xml/maint_print_struct.exp b/gdb/testsuite/gdb.xml/maint_print_struct.exp > index 6f411895501..5b7c1489d3e 100644 > --- a/gdb/testsuite/gdb.xml/maint_print_struct.exp > +++ b/gdb/testsuite/gdb.xml/maint_print_struct.exp > @@ -21,12 +21,7 @@ require allow_xml_test > > gdb_start > > -# Required registers are not present so it is expected a warning. > -# > -gdb_test "set tdesc filename $srcdir/$subdir/maint_print_struct.xml" " > -warning:.*" "setting a new tdesc having only a structure" Haven't you just deleted a test for a warning here? > - > -gdb_test "maint print c-tdesc" " This test (without the filename) actually tests for the change in your original patch - if we just update the expected output... > +gdb_test "maint print c-tdesc $srcdir/$subdir/maint_print_struct.xml" " This should probably be as well as retaining the above tests. I'd propose the patch below. thanks, Andrew > .*tdesc_create_reg \\(feature, \"bad_reg1\", \[0-9\]+, 1, NULL, 128, \"two_fielded\"\\);\r > .*tdesc_create_reg \\(feature, \"bad_reg2\", \[0-9\]+, 1, NULL, 64, \"bitfield\"\\);\r > .*" "printing tdesc with a structure and a bitfield" --- commit 416465d0331d3347bebf4c72c544d7d3ecb926e7 Author: Andrew Burgess Date: Fri Feb 17 10:15:27 2023 +0000 gdb: fix regression in gdb.xml/maint_print_struct.exp A regression in gdb.xml/maint_print_struct.exp was introduced with commit: commit 81b86eced24f905545b58aa6c27478104c364976 Date: Fri Jan 6 09:30:40 2023 -0700 Do not record a rejected target description The test relied on an invalid target description being stored within the tdesc_info of the current inferior, the above commit stopped this behaviour. Update the test to check that the invalid architecture is NOT stored, and then check printing the target description directly from the file. diff --git a/gdb/testsuite/gdb.xml/maint_print_struct.exp b/gdb/testsuite/gdb.xml/maint_print_struct.exp index 6f411895501..fbb16aeb8f5 100644 --- a/gdb/testsuite/gdb.xml/maint_print_struct.exp +++ b/gdb/testsuite/gdb.xml/maint_print_struct.exp @@ -21,12 +21,17 @@ require allow_xml_test gdb_start +set xml_file "$srcdir/$subdir/maint_print_struct.xml" + # Required registers are not present so it is expected a warning. # -gdb_test "set tdesc filename $srcdir/$subdir/maint_print_struct.xml" " +gdb_test "set tdesc filename $xml_file" " warning:.*" "setting a new tdesc having only a structure" -gdb_test "maint print c-tdesc" " +gdb_test "maint print c-tdesc" \ + "There is no target description to print\\." + +gdb_test "maint print c-tdesc $xml_file" " .*tdesc_create_reg \\(feature, \"bad_reg1\", \[0-9\]+, 1, NULL, 128, \"two_fielded\"\\);\r .*tdesc_create_reg \\(feature, \"bad_reg2\", \[0-9\]+, 1, NULL, 64, \"bitfield\"\\);\r .*" "printing tdesc with a structure and a bitfield"