From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YtufNEZmn2B9MgAAWB0awg (envelope-from ) for ; Sat, 15 May 2021 02:12:22 -0400 Received: by simark.ca (Postfix, from userid 112) id C97851F11C; Sat, 15 May 2021 02:12:22 -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 ACC9D1E01F for ; Sat, 15 May 2021 02:12:21 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3471A385781D; Sat, 15 May 2021 06:12:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3471A385781D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621059141; bh=MxGX57L5ql+BDrckLTCGj9L0dfaxVjQL9LShn7pXoiU=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=VnosaKIhc50n27+7e8/GpttCJhzcRmQm3DA83l4Bxs8Ddh+wnC0Q8d7skYkCOy7I9 pvP7DXtjDrku+UnEnHcijcj74L0XxRsifE8tOhvJ9rTrkF03B6PppIcNNrA68lKBto LkHwetBl9bS7nGh2GyVVxWTNFD5Lf1O1NrwymMlk= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 66720385781D for ; Sat, 15 May 2021 06:12:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 66720385781D Received: from fencepost.gnu.org ([2001:470:142:3::e]:32888) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhnX7-0000WC-Sm for gdb@sourceware.org; Sat, 15 May 2021 02:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48880) by fencepost.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhnX7-00020p-HJ for gdb@gnu.org; Sat, 15 May 2021 02:12:17 -0400 Received: from mail.ispras.ru ([83.149.199.84]:39092) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhnX4-0000Q7-NX for gdb@gnu.org; Sat, 15 May 2021 02:12:17 -0400 Received: from [192.168.0.92] (unknown [62.118.138.151]) by mail.ispras.ru (Postfix) with ESMTPSA id EB3E040D403E; Sat, 15 May 2021 06:12:08 +0000 (UTC) Subject: Re: Best approach for supporting snapshots for QEMU's gdbstub? To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , gdb@gnu.org, QEMU Developers , Luis Machado References: <87y2chjmsf.fsf@linaro.org> Message-ID: <4dd935c3-fe40-6ecc-f037-e6eaf7dc7821@ispras.ru> Date: Sat, 15 May 2021 09:12:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <87y2chjmsf.fsf@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=83.149.199.84; envelope-from=pavel.dovgalyuk@ispras.ru; helo=mail.ispras.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Pavel Dovgalyuk via Gdb Reply-To: Pavel Dovgalyuk Cc: =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= Errors-To: gdb-bounces@sourceware.org Sender: "Gdb" On 14.05.2021 19:06, Alex Bennée wrote: > Hi, > > I've been playing around with QEMU's reverse debugging support which > I have working with Pavel's latest patches for supporting virtio with > record/replay. Once you get the right command line it works well enough > although currently each step backwards requires replaying the entire > execution history until you get to the right point. > > QEMU can quite easily snapshot the entire VM state so I was looking to > see what the best way to integrate this would be. As far as I can tell > there are two interfaces gdb supports: bookmarks and checkpoints. > > As far as I can tell bookmarks where added as part of GDB's reverse > debugging support but attempting to use them from the gdbstub reports: > > (gdb) bookmark > You can't do that when your target is `remote' > > so I guess that would need an extension to the stub protocol to support? > > The other option I found was checkpoints which seem to predate support > for reverse debugging. However: > > (gdb) checkpoint > checkpoint: can't find fork function in inferior. > > I couldn't tell what feature needs to be negotiated but I suspect it's > something like fork-events if the checkpoint mechanism is designed for > user space with a fork/freeze approach. > > We could of course just add a custom monitor command like the > qemu.sstep= command which could be used manually. However that would be > a QEMU gdbstub specific approach. For now you can just use 'monitor savevm sn1' in gdb. But something like 'bookmark' seems more convenient. > The other thing would be to be more intelligent on QEMU's side and save > snapshots each time we hit an event, for example each time we hit a > given breakpoint. However I do worry that might lead to snapshots > growing quite quickly. > > Any thoughts/suggestions? >