From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id TlPYHaRurGIF4gIAWB0awg (envelope-from ) for ; Fri, 17 Jun 2022 08:08:04 -0400 Received: by simark.ca (Postfix, from userid 112) id 67FBE1E224; Fri, 17 Jun 2022 08:08:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 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 B914A1E143 for ; Fri, 17 Jun 2022 08:08:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28BD03834E70 for ; Fri, 17 Jun 2022 12:08:03 +0000 (GMT) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by sourceware.org (Postfix) with ESMTPS id DBF213857B9C for ; Fri, 17 Jun 2022 12:07:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DBF213857B9C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f43.google.com with SMTP id s1so5502002wra.9 for ; Fri, 17 Jun 2022 05:07:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=X86wSFR+8vRdHln4qf83txmXdL4Odqb/Vqv6/ern3XE=; b=c1blK21yvem7/bm+KuLGCGqj2ow56w4qu7k4p2mJkcxPcEl5In/wzc91uuYCxXaroB GKT5ujZYao7en3xNpC6EcG8sWg9wbXtZolKYSrsUZzt/xKRLI5w+D1IRXp1msKD+nkwi NAEftr0CaUaOPcIYJXZ3wZoarDCWFGsckLf6EizPj7bOE9tBJcBXKVW9ePmFb2cjFXvb 9ThRVXGhIA/5Z18b7JW3YUJ+Q/Nm0zCQ3/9DwoJ+84H3mkJI6Pi0tC4uqB/Psbco5C+C uyBSOOrihBjQZYxtdM+3XT6H9di9yCI3xCXwcCeMPMA7JWK5/Nh6Y1zzl0wSV3bYBEd6 Z6jA== X-Gm-Message-State: AJIora/Yoh3hT0WUQ1wZjQ2BT3w7+FzohW7wvgYX6OShcM4psGYkkAdk TzMhvX+0J9l2+9slPaQQkC3EGV1cTpU= X-Google-Smtp-Source: AGRyM1sfdu4nZoSITZ8dwd5fA2G7LfR57DIBB2ytLFnfRrsJiiaerOrf5wSfoDnXHtZqYOMxde+l3w== X-Received: by 2002:a05:6000:1546:b0:218:555b:98ff with SMTP id 6-20020a056000154600b00218555b98ffmr8889693wry.698.1655467665464; Fri, 17 Jun 2022 05:07:45 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id s6-20020a05600c29c600b0039c948dbb61sm5180942wmd.26.2022.06.17.05.07.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jun 2022 05:07:44 -0700 (PDT) Message-ID: <1e63f554-b24b-0bfb-e97d-d182ca6a41d2@palves.net> Date: Fri, 17 Jun 2022 13:07:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [RFC] Change displayed line when execution direction is reversed Content-Language: en-US To: Bruno Larsen , gdb@sourceware.org References: <040e723a-1f8b-3fb2-a076-85664243513f@redhat.com> From: Pedro Alves In-Reply-To: <040e723a-1f8b-3fb2-a076-85664243513f@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On 2022-06-15 13:25, Bruno Larsen via Gdb wrote: > Hello all, > > I was doing some reverse debugging and noticed that setting the execution direction to reverse does not change how GDB displays lines. The problem with this is that the user doesn't see what will be executed if a step is taken, which makes the user experience quite annoying. How would the community feel if GDB printed the previous line, instead of current line, when the execution direction is reversed? > > Sorry if this is the wrong list. It didn't feel like a bug, and I don't have a patch yet, so this felt like the best place to send. How do you know which line that would be? E.g.: if (foo) func (); else bar (); qux = 0; // stopped here. Say you're stopped at the "stopped here" line, and flip execution direction to reverse. Which line would gdb show as next line? Also, showing a different line would result in the current PC (p $pc, info registers) etc. printing an address for a line totally unrelated to the line that GDB is displaying, no? Same for "break" with no arguments, etc. Worse, what happens when you print variables? The block scope used is the one for the current PC, while gdb would display a different source line as current line? I don't see off hand how this can work. Can you detail it?