From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: Fri, 17 Jun 2022 12:07:49 -0000 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?