From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9/fwKjh6lmcsihsAWB0awg (envelope-from ) for ; Sun, 26 Jan 2025 13:08:56 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=mHYDtaMF; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9D9251E105; Sun, 26 Jan 2025 13:08:56 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9A0CB1E08E for ; Sun, 26 Jan 2025 13:08:55 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0EA64385842C for ; Sun, 26 Jan 2025 18:08:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0EA64385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1737914935; bh=MMEIcI02zNZZbEgrW+N+hktFrSUlUsrvsn/6AxXCwgg=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=mHYDtaMFWR2Jj+8JJU4+dT+ba75hyR6YGuev2O+gXZ3NC7OxsSkcrKNOAtOH0DIuH 65dWwvsVr+P/KtrlCuV0+AM8qbB6wKX3DJygFJdBikY80q9a0rsE0E/wCjOFHkDmx9 wYTWIZ0OM7mcvbod7Oju0ZM+O3Ujk9Y2yvheW6s8= Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by sourceware.org (Postfix) with ESMTPS id A57E43858D37 for ; Sun, 26 Jan 2025 18:07:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A57E43858D37 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A57E43858D37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737914870; cv=none; b=Not9RuSxhO69c1mE+7Wqi4vRk0G7uOSgRGjgyBGd0Qf6xiPzsrCUYjp7hLnvuPCBQUOMn6m/3Q9wc40rf6RZfASELXmfRLWkhP1tRlOFDmwD745POjm6JOhLSpo16mhQrz4r6RHlBOyLojAuAHeiGndlPdd2NwCZUjyZ3TLyO2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737914870; c=relaxed/simple; bh=rufpAubkhVdWLtYkBli46xMbmsqpcQdctDvsH7/NeUw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=CBGevgxi/l2wpe0XNW4Vn7aDmISqzbDwr+LwNn3oxxjI5W3MCgWV13Wd/6AAXjfGjrBBle043Led47AETqUhGKPuKxZ8UO9oqYFPJK59L4orfklKXOeNLWcEbaWt3Ltr5brCZMb0wk6i0ecUKplAi7xO7Vk8GpBmUWwVLfnMpZE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A57E43858D37 Date: Sun, 26 Jan 2025 19:07:47 +0100 To: Stephen Brennan Cc: gdb@sourceware.org, linux-debuggers@vger.kernel.org, Omar Sandoval , Amal Raj T Subject: Re: GDB Remote Protocol Extension - Linux VMCOREINFO - Request for Feedback Message-ID: <766010fa-49a5-4e86-a730-bf79bb73e928@t-8ch.de> References: <8734hmtfbr.fsf@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8734hmtfbr.fsf@oracle.com> X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?Thomas_Wei=C3=9Fschuh_via_Gdb?= Reply-To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" Hi Stephen, On 2025-01-13 16:22:00-0800, Stephen Brennan wrote: > I contribute to the drgn debugger [1], and work on debugging the Linux > kernel a fair bit. Drgn is particularly well-suited to the Linux kernel > and contains a lot of support for it. It currently supports attaching to > live targets via Linux's /proc/kcore, and core dumps. We are looking > into supporting remote targets via GDB's remote protocol. > > One piece of information that is very useful when debugging the Linux > kernel is the VMCOREINFO note[2]. This is a free-form piece of text > data, typically around 3k bytes, which contains information that > debuggers would find useful in interpreting a Linux kernel memory image. > In particular, it contains the KASLR offset, the build ID of the kernel, > and the OS release. With this information, a debugger could attach to > a live GDB stub (e.g. kgdb, or QEMU) without needing to specify > debuginfo file names or memory KASLR memory offsets. > > To that end, we hope to extend the GDB remote protocol with a facility > that would allow the debugger to request this information. We've written > up an idea for this proposal at [3]. The summary is: > > 'q linux.vmcoreinfo' > Retrieves the Linux vmcoreinfo data. > Reply: > 'Q [DATA]' data is encoded as described in the Binary Data doc [4] > 'E.' with an informative message if the data is not available > > However, with the candidate kgdb implementation taking shape [5], we're > becoming concerned regarding this design. It seems that there is an > implicit maximum packet size which is not described in the protocol > documentation. Many stubs have small(ish) shared output buffers. It > seems to me that data which would be 3k bytes before escaping is too > large. We've noticed that there is a 'qXfer' query packet which allows > specifying an offset and a number of bytes. Maybe it would be better for > us to add a new 'special data area' for the 'qXfer' message, and reuse > that command? Do you need to transfer the full vmcoreinfo data? Wouldn't it be sufficient to only include the address/size of the vmcoreinfo note in memory and the debugger can read the data from there with regular memory access commands? That information is enough for QEMUs vmcoreinfo device. It would simplify the design and implementation(s) significantly. Thomas