From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 3D8463858D1E for ; Wed, 4 Jan 2023 10:30:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D8463858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672828227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R4YLtRNxhKNrRiDvXYreD5Ovh5KpGxouXPiVH/rLE8Q=; b=JIAMohS126NlgnFs6KoljOJ0M4SjuIvBdnhWob57r2A3nK1HIBW0rcyGG/hv+M9n9uUdyJ Tck+TUIOYg0ExRClNYx5FrlKNazwkbzLfRkcpxbF98HJpdNdBAKcUYbyKITlUTJp1pTb1k apbXX6X+EbFjMCmo5HSbSUGlObjNHIg= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-41-77YFeBdYOaGNpkueiFsZoQ-1; Wed, 04 Jan 2023 05:30:26 -0500 X-MC-Unique: 77YFeBdYOaGNpkueiFsZoQ-1 Received: by mail-wm1-f70.google.com with SMTP id l31-20020a05600c1d1f00b003d9720d2a0eso17810301wms.7 for ; Wed, 04 Jan 2023 02:30:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R4YLtRNxhKNrRiDvXYreD5Ovh5KpGxouXPiVH/rLE8Q=; b=ZTYQ7Vw9LbLPl8p6YeBR4sUiCChQvVXFvm45GEzx7rE5ISVrZqIjF6KqyfK9S8HE0Z kkMof8LcLwBTYgRCx33XsQb2oBuO9fCkS/iYWEgAqaE+0YGN8BLTZKsRj/H3x7BIvIA7 HWYJrvotub+r1e/r4HK597vlM/QBi1KmW5+ov6ChThYaSeyMzyp0wqXhwlWfug8/MDEw 5V7MtVWTAUmVJvj0AEMKOvutksHPfis0GyYcFxVeB8WL7r09v/6o4u04KQ8bjiQ+w2rt h6F11AS1zxpJXV73ZjxOk4cTf/qRr3LQHHcVW8aAJQfBa9Pce917M+Te79gPF0ys20lD Oriw== X-Gm-Message-State: AFqh2koDkCTceW0sR62Iy6jPfODZgOqjwrV/2ZAPxo/OzL8C2YIMFmjx dPeMXE7dFS+HhHWZUoHayjeQRWgwFWkiTq9gYRZy7aHnth//KhRTMKoRUS9Uno5OMYaMq9oox1Z 0RASF+L8j7f6li1kUK1k5ai1mF4XCK9jM7LANSvJS95/EUjfeZXZFKw1JlfeWMVHtqibO9Hwq X-Received: by 2002:a05:600c:4d25:b0:3d2:27ba:dde0 with SMTP id u37-20020a05600c4d2500b003d227badde0mr34106387wmp.33.1672828224685; Wed, 04 Jan 2023 02:30:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXusOXjJ+d47sV4iw+cPjZL0wHc0eQZblU+fDLXSxGno/wVcOOBfTVyVDsfiXBswg05ok6EDSQ== X-Received: by 2002:a05:600c:4d25:b0:3d2:27ba:dde0 with SMTP id u37-20020a05600c4d2500b003d227badde0mr34106373wmp.33.1672828224417; Wed, 04 Jan 2023 02:30:24 -0800 (PST) Received: from [192.168.0.45] (ip-62-245-66-121.bb.vodafone.cz. [62.245.66.121]) by smtp.gmail.com with ESMTPSA id t17-20020a05600c199100b003d99da8d30asm24129113wmq.46.2023.01.04.02.30.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Jan 2023 02:30:24 -0800 (PST) Message-ID: <46b65187-a6e8-20a1-7820-37d3dde95357@redhat.com> Date: Wed, 4 Jan 2023 11:30:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v3] gdb: add 'maintenance print record-instruction' command To: gdb-patches@sourceware.org Cc: Eli Zaretskii References: <20221222154338.2223678-1-blarsen@redhat.com> From: Bruno Larsen In-Reply-To: <20221222154338.2223678-1-blarsen@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 22/12/2022 16:43, Bruno Larsen wrote: > While chasing some reverse debugging bugs, I found myself wondering what > was recorded by GDB to undo and redo a certain instruction. This commit > implements a simple way of printing that information. > > If there isn't enough history to print the desired instruction (such as > when the user hasn't started recording yet or when they request 2 > instructions back but only 1 was recorded), GDB warns the user like so: > > (gdb) maint print record-instruction > Not enough recorded history > > If there is enough, GDB prints the instruction like so: > > (gdb) maint print record-instruction > 4 bytes of memory at address 0x00007fffffffd5dc changed from: 01 00 00 00 > Register eflags changed: [ IF ] > Register rip changed: (void (*)()) 0x401115 > > Approved-by: Eli Zaretskii Thanks everyone who reviewed. I implemented the suggestions and pushed the patch -- Cheers, Bruno