From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IezhKTegY2C5dQAAWB0awg (envelope-from ) for ; Tue, 30 Mar 2021 18:03:35 -0400 Received: by simark.ca (Postfix, from userid 112) id 9AEF71EE0E; Tue, 30 Mar 2021 18:03:35 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 C7FD21E789 for ; Tue, 30 Mar 2021 18:03:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 288293858012; Tue, 30 Mar 2021 22:03:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 288293858012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617141814; bh=20T2gsnBsCc5zSOT/97eK6owjdrLtOBtWs4gx4PlLFE=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=KDebe5x7tX9+PqexvllEB7kYmHI9fZWuXMhaggJVOZIJkWNqTKdW6tku5xp+9IN+V moLIF1cyOUppL7g2FJmRF/enuk/a0lgtoqMAiP+KlNpXTZRUteQYEFKOG6THJLy2Ie AlzMrCHa8q4aSIqobMKTUH8zChzUfm5Tob/+LRac= Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id F00A6386184C for ; Tue, 30 Mar 2021 22:03:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F00A6386184C Received: by mail-pl1-x636.google.com with SMTP id f17so6867349plr.0 for ; Tue, 30 Mar 2021 15:03:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Zz3ZK21VkQci06YvF55pFtbkqWrvSumDQlZU8168GSo=; b=H23Qp/8MeMYYXcWoMKgqXFw5PSO7WDJqejDG8rB5oC9RWK7lHH1na0B+ACcYe9eTV3 YHnUBHxKfaMACjEbDFCSrvF4oy5vXHB58o4Nqj7M6Lp4M7qi+ffefXZWgL8Nffu3tTKf u172s58zcGeyyRV4wxl5lDlNWC77jnAlXKc/aKXjwoequON7HqHP9fJYPbvKg2N5N/qF TvvPNe2Yz/zKtnCrcMoYBpiM/4ZS6ZamYthpt8dNf7uUPIVN5NBjKgsGTjIu83yIMB0n M/rGAXCRlinxX3qTtYvWsbEMojQaMbO/tEfyp21/53sfnUSpGjjQtFOY59TL6zns9GeW c5kA== X-Gm-Message-State: AOAM5301WN+NS2wyNMXkXg5/DFSP8TMrDRHZ01C0OSUc8k1VXRFEF+Bi Tj7SHYrv9Y76bhY4BaEziRzI7xkRHIIeZRk8ACs= X-Google-Smtp-Source: ABdhPJwgSwS/vAm9HxjbOUWn8sMXXPQ+EDWw9FvLssZ50eetXxyHH7ngnSYJLOiMrspO8vbYjEYhLLniNFx0Lw+hHPk= X-Received: by 2002:a17:90b:3553:: with SMTP id lt19mr389937pjb.222.1617141811149; Tue, 30 Mar 2021 15:03:31 -0700 (PDT) MIME-Version: 1.0 References: <6b00bbbe-1400-7f11-bdcf-811595bf8e31@polymtl.ca> In-Reply-To: <6b00bbbe-1400-7f11-bdcf-811595bf8e31@polymtl.ca> Date: Tue, 30 Mar 2021 15:03:20 -0700 Message-ID: Subject: Re: Remote query for structure layout To: Simon Marchi Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: David Blaikie via Gdb Reply-To: David Blaikie Cc: Tim Newsome , gdb Errors-To: gdb-bounces@sourceware.org Sender: "Gdb" On Tue, Mar 30, 2021 at 2:49 PM Simon Marchi wrote: > On 2021-03-30 5:41 p.m., David Blaikie wrote:> > > Is the register layout in this struct part of the ABI? If so the > debugger could assume it/hardcode the knowledge. > > I don't think this is part of any ABI, this is just how FreeRTOS stores > the registers of inactive tasks. So it's like an implementation detail > of FreeRTOS, but one that the debugger needs to know in order to inspect > existing threads. > > From what I undersand from Tim's message, the GDB stub inside OpenOCD > already hardcodes that knowledge, but the problem is that the layout can > change based on compilation options (which OpenOCD probably can't easily > detect), and the layout could change between FreeRTOS versions. > > > If not, then it seems to me the right thing might be for the compiler to > have builtin support for emitting this struct under a reserved name into > every CU, perhaps? Not relying on source quirks to encourage it (as you > say, would leave you at the whims of the compiler implementation), but > actually make it explicitly part of compiler support for this architecture. > > Maybe an attribute > > struct the_struct { > } __attribute__((always_emit_debug)); > > ? > Perhaps - though I was thinking actually hardcoded in the compiler - since it's the one that chooses/knows the layout, it's not (presumably) using any code it reads from a header, etc, in user code to define the layout.