From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by sourceware.org (Postfix) with ESMTPS id E2C633865479 for ; Mon, 14 Mar 2022 13:24:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E2C633865479 Received: by mail-io1-xd30.google.com with SMTP id w7so18156876ioj.5 for ; Mon, 14 Mar 2022 06:24:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=AO9a7YEfxxg04on01JuJGGVpmLgRY6InTSOCBY/rCHk=; b=hmh1PtRYG0OzGw+uMShn1qhXOBcbXWcydVwvBCNPzLyCQEvWAdlu8FF8iw0/qr83QK sgGVMTPYiSqGOZ1lj3URceFeGxPCJWmrLTLlHqzjZEwkC8gcLUW9RAkxEU7PnIl0mkCS zNwiU1gWc1d3zPpgSQtrUvSZ+mAiOHksvG7GEE8zYFrt00lNbH2U11b/pyQD7bAQdsss giuAF0IBZKNu3nug+sugHa9Sc8T8I2C1lL5BojK1WA7/L9dMaKVl70gd9jJ2yTfBiiRB 9JZUm9g3gvb9PTIdbzLZL1ohnfsIjEQFE97pWUJ/ryNg2RW+4flty+S3cfQAyAtE7XGI XNSQ== X-Gm-Message-State: AOAM530vDJnGzSa+/bXTVwo4ycOtNpJQ4cVxMRGT6JSe7wlUY6gO6YvI jXVUESmpipcLAm1U0gqF+PbeL/RG3rBizg== X-Google-Smtp-Source: ABdhPJwmtMvpYIorIxGkJ5966WJgI6d1AHyPZ8LQwaHC32jbPCGiJ5RYtPG9fGMko56FJdntKCt4BA== X-Received: by 2002:a05:6602:1593:b0:648:aa01:8d89 with SMTP id e19-20020a056602159300b00648aa018d89mr17813821iow.149.1647264255181; Mon, 14 Mar 2022 06:24:15 -0700 (PDT) Received: from murgatroyd (71-211-175-224.hlrn.qwest.net. [71.211.175.224]) by smtp.gmail.com with ESMTPSA id s12-20020a92cbcc000000b002bd04428740sm9078710ilq.80.2022.03.14.06.24.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 06:24:14 -0700 (PDT) From: Tom Tromey To: Luis Machado Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Implement gdbarch_stack_frame_destroyed_p for aarch64 References: <20220311163133.668809-1-tromey@adacore.com> <00c20109-0a0c-b70c-a962-5a64539cc43a@arm.com> X-Attribution: Tom Date: Mon, 14 Mar 2022 07:24:14 -0600 In-Reply-To: <00c20109-0a0c-b70c-a962-5a64539cc43a@arm.com> (Luis Machado's message of "Mon, 14 Mar 2022 09:30:25 +0000") Message-ID: <87ee34lla9.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 14 Mar 2022 13:24:17 -0000 Luis> Are the passing/failing runs using different compiler versions? Nope. Luis> If the Luis> variable no longer exists, then having a stale location like that Luis> seems wrong. Can you pinpoint what is different from a passing test Luis> and a failing one? GDB version, compiler version, different binary? I didn't dig quite this deep but I think it's different memory contents in the caller's stack frame. Luis> These hooks seem to take care of functions without debuginfo, so they Luis> tend to walk instruction by instruction to figure things out. No, this is a case with full debuginfo. What's happening is that the DWARF for the callee describes the location of a variable as relative to the stack frame: > DW_AT_location : 2 byte block: 91 7c (DW_OP_fbreg: -4) However, at the end of the callee, there's an 'ldp' instruction -- which resets the stack pointer. So now, that variable's location description points to an offset relative to the caller's frame. However, this is clearly incorrect, because the caller and the callee generally will not agree on the relative location of anything in their frames. Basically, this is a kind of epilogue detection. It might be better if the compiler told gdb about this (but it doesn't) or if variable locations ended at the 'ldp' (but they don't). Tom