From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id BCFE5386181D for ; Tue, 30 Mar 2021 20:35:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BCFE5386181D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tim@sifive.com Received: by mail-ej1-x635.google.com with SMTP id kt15so26721195ejb.12 for ; Tue, 30 Mar 2021 13:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=8j19su2NpcAZSJzDWV9Bw7uyUSFjDtyHKEZkIZD355Y=; b=NkqCeHm00YzuMydmsAlyLWgJuRYMP6yH0DA9RDq84icckGoS5LJ3GwoSKVpXb6bXxq VYhoDoE/KUGCSe0LicXa6xNvczb+W1x9P8hsEmbJdfKYxRAA33j3fV3ik93N0b3ndhvw 35GeMWlR1Uu/r+F7mhsSWMgJOzsv4baQXhuICkcttGSpEODwWROiKvMUMNXbyX8aV+Cw 5tbo+Oz//l0x2LBBjk2JOdz4rbh39sNZBnqIwNHgX6iwLnhMung1q3pO3kCWdIA6WbIO WdaVXDnjwknxwhANbliXaS3U2FWVp/W38p4UH294QHXZHz7dBH1ks5e9cOrQqbkHnSKt CQTQ== 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; bh=8j19su2NpcAZSJzDWV9Bw7uyUSFjDtyHKEZkIZD355Y=; b=g5P+4WRruY9J6+jJ5WpvYrSoUyDumpB/vaS6CufoefXEqJl+7xjoSVdFtYPwwvegCb y31ay/umGRK99i8EMBCJb7NlspqvxZNkB3p/9vO7+7DYTjILH6hEYZ8BLIokkTA9dQob VoEZnHeOQWzock03htheiYJEBM8JBbOYHlzEKIEfIOTuEOOrktW1PskfySuqTepvtwqZ HrPEdjTcTSS4zzvVl/bVjatjUrZW6C+mmzxb499AsyONaDmdVZ53u20oIq9fdcjdJncJ TjoqqS8YMJ78SNcOWr7l1r5yaJ6nJRjhrPTp/wjKh3WNtYo4QFEq1tjaQ3KiCIyjy7LL ufaA== X-Gm-Message-State: AOAM5308THQmhkCQ14D2zPe7t9+ee9Q+L7Zixchf4rSGJX9B0julV3C9 Y6CSkyGam1e+bmZ0BZoJHmLu/tP9VUbGnIuTAyf+iWbtVpqE5A== X-Google-Smtp-Source: ABdhPJzio+T1Aat6bKq7M3x1b19hEDFWDsRELRMt6Qp5enPegyJn8q603egDbryncqYDxRN3lvC6AvhlcJgKHg0bpY8= X-Received: by 2002:a17:907:7699:: with SMTP id jv25mr34007889ejc.363.1617136525624; Tue, 30 Mar 2021 13:35:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tim Newsome Date: Tue, 30 Mar 2021 13:35:14 -0700 Message-ID: Subject: Re: Remote query for structure layout To: gdb X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, 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 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: , X-List-Received-Date: Tue, 30 Mar 2021 20:35:28 -0000 On Sun, Mar 28, 2021 at 5:00 AM wrote: > I would like to propose a new command for the remote protocol that can be > used to > query structure layouts. > Essentially a `qSymbol` equivalent for the output of `ptype`. > I'm really interested in this. I've been working on OpenOCD FreeRTOS support and as Thomas points out, it's a fragile mess. There's another use case that this would be great for. FreeRTOS stores registers on the stack when it switches to another thread. OpenOCD needs to know what this register layout is, and it also depends on compile time options. With this mechanism I think it would be possible for FreeRTOS to define a struct that represents how the registers are laid out on the stack. E.g.: struct register_stacking_t { uint32_t x1; uint32_t x2; uint32_t x3; uint32_t x4; ... uint32_t pc; }; Am I right that this will end up in the dwarf info even if the struct itself isn't used anywhere in the FreeRTOS code? This would simplify so much. Tim