From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by sourceware.org (Postfix) with ESMTPS id AD7FD385B834 for ; Thu, 23 Jul 2020 18:58:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AD7FD385B834 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f49.google.com with SMTP id a15so6143665wrh.10 for ; Thu, 23 Jul 2020 11:58:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ESEf/HbKmEADobNZU30C3WvWfztCskzQ0JyPhFkKFa0=; b=Y7yM1W2+xOxOHCiGfh3NH38JW1qJv0qQD+gVrEVurCKxJ47ezNxgLUwTMTJ1+vQoBp xwno4HZUaHkAC5WR/yrRFELaJmV0HDxlJvtn58vwJsHAa3tYloK6IVISh61rNcJAEb/X FDK0ooD3csVKQ3ZqYuuy0cHLHb/AqxsbjCTpApGaUbGqCPJPyBWjoXQuPDIGt7Ik26OQ /vEQUIlrOkkGA/KNnXqOHoQqA8jVOv9DF+owJn2EPXJLhtpgB6In+50Jt1BJQ5t/hsU4 7Rvlb0ZPkGX46nRlKeJN+kkd3oOn8ytYexzul8a2xKI0mefsT3SrFjagmO+pOs4njJD8 N9cg== X-Gm-Message-State: AOAM531p71ShUWfncSTG8S++uUB/3HCjd1DOIkapxx8S72bbkZQHVlt4 RSEUbwt99HQs4ClnhQ9TOvAaUGYWafY= X-Google-Smtp-Source: ABdhPJx5abl3JDE803dCR5oUMsLpPvipj3ZmNUXPvkmCk0vbVTbtrGUbBYCQSdIqzwedn9V3oaCayQ== X-Received: by 2002:adf:97dc:: with SMTP id t28mr4890665wrb.291.1595530723254; Thu, 23 Jul 2020 11:58:43 -0700 (PDT) Received: from ?IPv6:2001:8a0:f91a:c400:56ee:75ff:fe8d:232b? ([2001:8a0:f91a:c400:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id q7sm4820984wra.56.2020.07.23.11.58.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jul 2020 11:58:42 -0700 (PDT) Subject: Re: [Patch] GDB: aarch64: Add ability to step over a BR/BLR instruction To: Matthew Malcomson , Alan Hayward References: <9226b8ae-aaea-65c3-3e86-f607b11fd375@linaro.org> <9EACDC38-BB8D-4804-AD19-057E3309819A@arm.com> Cc: nd , gdb-patches From: Pedro Alves Message-ID: <3d86bcb9-dedd-6eb2-7cff-e8349d4b20da@palves.net> Date: Thu, 23 Jul 2020 19:58:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 23 Jul 2020 18:58:47 -0000 On 7/23/20 5:48 PM, Matthew Malcomson wrote: > + > +# Test for displaced stepping over the BLR instruction. > +gdb_test "run" \ > + "Starting program.*Breakpoint $decimal.*" \ > + "Run until BLR test start" > + Please don't use "run" directly. Use one of runto, runto_main, gdb_run_cmd instead. See amd64-disp-step.exp for example. If you use "run" directly, then the testcase won't run against gdbserver. Please make sure this passes cleanly: $ make check \ RUNTESTFLAGS="--target_board=native-gdbserver" \ TESTS="gdb.arch/aarch64-disp-stepping.exp" > +set expected_lr [get_hexadecimal_valueof "\$pc + 4" 0] > +gdb_test "print/x \$x0" \ > + ".. = 0x0" \ > + "Ensure x0 is 0 before BLR test." The ".." at the start of the pattern are not necessary, gdb_test will match anything that appears before your pattern anyway. Use lowercase, and no period at end. Throughout. "Ensure" is redundant, IMHO. Every test is ensuring something. So, I'd write: gdb_test "print/x \$x0" \ " = 0x0" \ "x0 is 0 before BLR test" > +gdb_test "print/x \$lr == $expected_lr" \ > + ".. = 0x1" \ > + "Ensure LR is set to just after BLR." Is set to ... ? Please cat the testsuite/gdb.sum file after running your testcase in isolation and skim it to make sure it all makes sense. You can also use with_test_prefix "BLR" { ... } with_test_prefix "BR" { ... } to group tests. Thanks, Pedro Alves