From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id 4E6233857C57 for ; Thu, 24 Sep 2020 15:32:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4E6233857C57 Received: by mail-qt1-x843.google.com with SMTP id n10so3290825qtv.3 for ; Thu, 24 Sep 2020 08:32:06 -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:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jI0Xh+xkxr/BQnYkW/0ZIPbV1LyBOmT38vaWftiLtBk=; b=VzwBiKYQSHexrg81qflr8gjXe7rNmt62YsJynSnCDCzRtl2ENDc/qfB+fZwfL8Inmi P0tmmmmabmy6hqtwx7u3X9p4ELwzla/KTUm959ymiucEj2zsV3qB6JEB/ep++DV+hOgr 4y12dGKl54SEVwle4pry35+pehSAFGLJEfXXuRXL7Qy7TE+YLQeOGtc8sQfgqWkS1D4C Pr/q0U7VM1PkiCzFuMpkG0iEm9dAothIgkjuD67M3IKc1kv8m/4qpxJz7c/N5hqEimGF uCbhsp0sAYn9JOn5FUUgxR3Mu0irylqF7dTRS2VRJeLZky5XOa6hEEEayk5MeJtCZ1DI mq+g== X-Gm-Message-State: AOAM532GX/9I1XA6w+Tbo4TqbLvV0ztrx91gVGBPFO8NklNI7ppOIWfS eA1FyVFFFGmqp7MxzrFeq3/L7x2o5hQrvA== X-Google-Smtp-Source: ABdhPJzVJXtbmbCOhMNjyFmnMFu38qE5mWs0GiFR6Cyuc6UIJU2q2OBxFT0i/jJ5aY/BssGWhBZvfw== X-Received: by 2002:aed:3387:: with SMTP id v7mr151239qtd.68.1600961525652; Thu, 24 Sep 2020 08:32:05 -0700 (PDT) Received: from ?IPv6:2804:7f0:8283:9bb9:918a:df76:92c7:9420? ([2804:7f0:8283:9bb9:918a:df76:92c7:9420]) by smtp.gmail.com with ESMTPSA id j31sm2495761qtc.33.2020.09.24.08.32.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Sep 2020 08:32:05 -0700 (PDT) Subject: Re: [PATCH] Don't drop static function bp locations w/o debug info To: Pedro Alves , Simon Marchi , gdb-patches@sourceware.org References: <20200612192108.11481-1-pedro@palves.net> <22959b69-54bd-012e-4026-feb4f02ac671@simark.ca> <5aea0e8a-2d19-3fa0-5281-86e41be4b8b9@palves.net> <1f254bd1-e75a-cdf3-e7c6-e89d51216635@linaro.org> From: Luis Machado Message-ID: <28a2dbf2-d9dc-0ffe-8b45-fa36a3522b25@linaro.org> Date: Thu, 24 Sep 2020 12:32:00 -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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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, 24 Sep 2020 15:32:07 -0000 On 9/24/20 12:16 PM, Pedro Alves wrote: > On 9/22/20 9:20 PM, Luis Machado wrote: >> The new tests are failing for aarch64-linux-gnu on Ubuntu 18.04 (GCC 7.5.0). >> >> The breakpoint location patterns don't seem to be matching. Here's what I see... >> >> info breakpoint^M >> Num     Type           Disp Enb Address            What^M >> 1       breakpoint     keep y            ^M >> 1.1                         y   0x0000000000000794 ^M >> 1.2                         y   0x00000000000008bc ^M > > The test is: > > test_info_break_2 \ > "" \ > "" > > So it should be trivial to adjust with > > - "" > + "" > > > However, I wonder whether we're actually seeing a bug here. > It seems like on x86, the breakpoint is set past the > prologue (thus the "+$decimal"): > > Num Type Disp Enb Address What > 1 breakpoint keep y > 1.1 y 0x0000000000001050 > 1.2 y 0x0000000000001165 > > while it is set exactly at the function's address on Aarch64. > > Why didn't GDB skip the prologue of on Aarch64? > Is there really no instruction to skip? > > Here's what I see on x86-64, without debug info > (outputs/gdb.base/msym-bp-shl/msym-bp-shl-0): > > (gdb) info breakpoints > Num Type Disp Enb Address What > 1 breakpoint keep y > 1.1 y 0x0000000000001050 > 1.2 y 0x0000000000001165 > > and on x86-64, with debug info > (outputs/gdb.base/msym-bp-shl/msym-bp-shl-1): > > (gdb) info breakpoints > Num Type Disp Enb Address What > 1 breakpoint keep y > 1.1 y 0x0000000000001050 > 1.2 y 0x0000000000001165 in foo at src/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c:21 > > Note the location addresses are the same without vs with > debug info: 0x1050 and 0x1165. Is that also the case on Aarch64? It is the same case for AArch64. The reason for not skipping a prologue is because there doesn't seem to be one. The generated code for aarch64 is the following: (gdb) disass foo 0x00000000000008bc <+0>: nop 0x00000000000008c0 <+4>: ret End of assembler dump. I guess the assumptions of the test are valid for x86, but they're not valid for aarch64.