From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id BvfOOPJ7wWNtEhYAWB0awg (envelope-from ) for ; Fri, 13 Jan 2023 10:42:42 -0500 Received: by simark.ca (Postfix, from userid 112) id E04211E128; Fri, 13 Jan 2023 10:42:42 -0500 (EST) 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=pE9BsSm7; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,URIBL_BLOCKED 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 91A771E110 for ; Fri, 13 Jan 2023 10:42:42 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D5FF038543AF for ; Fri, 13 Jan 2023 15:42:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5FF038543AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673624560; bh=fOtT6zyGTluiFpDiLWhW25RB5U0ZiFBv/U4yry0qakk=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=pE9BsSm7mhRC/8P+9UbtaQulmfaXH8rc9cHATgmFLVFKJLEU0xtKCVo3+6zNIa5tP xsfxquvayaBrz0RivV0kZTyl3cAS7bqHMen0PgtfdrssCvGCGcdNeM/Qn4zeTmXC92 9mSGjYT7yBOI+/aqH9NZMoassMUHoB/NYaOdPpi4= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id C1A063858D37 for ; Fri, 13 Jan 2023 15:42:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C1A063858D37 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-446-6Q8muD0aODaz3oClX_h4xw-1; Fri, 13 Jan 2023 10:42:20 -0500 X-MC-Unique: 6Q8muD0aODaz3oClX_h4xw-1 Received: by mail-wr1-f69.google.com with SMTP id i28-20020adfa51c000000b002ba26dfcd08so4271278wrb.18 for ; Fri, 13 Jan 2023 07:42:20 -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: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=fOtT6zyGTluiFpDiLWhW25RB5U0ZiFBv/U4yry0qakk=; b=xxo4iB3AebVKeFpd3OaOKbttwDal2KVa+a9hLW25JPXhrtRqTBk7OT/BwbQG23zH1u ykjOa4UplurgDTNhvRtLvhXqQ1M/kqTUE5is444qPVn6f6liA/ntZ6FR//RAqovnJSAa 5C60fnNTmjZRxtK3UKTCM1DvQhQfIiqgtn9XVheyNAjX7tICZCG46+5h/1lUOvPW9NDe 3yGrbOe7Uj/8BLXr4moRUoALAvTp0CsvaWCARYN6T/a28LYOerrGWZ4YB//rnBH2m+tw xXmL4PzvBqy04Zx1uUQXyUyuzrqFWTfIiXtC1Jqqu5iEkpuQNN8Rej/hgZ3iyt15g5m/ EJBg== X-Gm-Message-State: AFqh2kouEypt8q9yijykI+NpHKGNHRGtedUgzs4HexJhpFPnjFmddt29 Msr4UWEnxTxHuQWLdNaX3OrYaVT222jnFK0h9ujWjot+D0ZaTILcOeprCt5rDkGNs/EEj/dJmpT g76i8t1eUSqzfvqRaQMM14Q== X-Received: by 2002:a1c:7401:0:b0:3d3:5506:1bac with SMTP id p1-20020a1c7401000000b003d355061bacmr99162wmc.30.1673624539127; Fri, 13 Jan 2023 07:42:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXtpItaOEzKNJw8vwyEx3trSuV+8Z572AqCur/rvrKXgSqpGj7ySG5/2gCy4TLHtLINFORhS4Q== X-Received: by 2002:a1c:7401:0:b0:3d3:5506:1bac with SMTP id p1-20020a1c7401000000b003d355061bacmr99153wmc.30.1673624538903; Fri, 13 Jan 2023 07:42:18 -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 m18-20020a05600c4f5200b003c6b70a4d69sm28856621wmq.42.2023.01.13.07.42.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Jan 2023 07:42:18 -0800 (PST) Message-ID: Date: Fri, 13 Jan 2023 16:42:17 +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 1/2] fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-reverse.exp To: Carl Love , Ulrich Weigand , "will_schmidt@vnet.ibm.com" , gdb-patches@sourceware.org References: <5b50668cbe882c57b8c0e9dcf5be0a253713c4c6.camel@us.ibm.com> <51c4bfc82ac72e475e10577dc60e4d75fa48767e.camel@de.ibm.com> <3ea97a8aa9cccb39299adde682f92055d1986ab3.camel@us.ibm.com> <53878e37c6e57de1d04d9c9960c5d0a74324ee6e.camel@us.ibm.com> <50474aa92ba82eff05cdc8f49001eae56be29670.camel@us.ibm.com> <89331c26795e3f7743e1e068dce43b3c2dd53008.camel@us.ibm.com> <071f24ecf9b3a2bbbe8fee7db77492eb55c5f3ff.camel@us.ibm.com> <1d9b21914354bef6a290ac30673741e722e11757.camel@de.ibm.com> <3e3c9c40f07ab01c79fe10915e76ffa187c42ad9.camel@us.ibm.com> In-Reply-To: <3e3c9c40f07ab01c79fe10915e76ffa187c42ad9.camel@us.ibm.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-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Bruno Larsen via Gdb-patches Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 11/01/2023 19:27, Carl Love via Gdb-patches wrote: > diff --git a/gdb/infrun.c b/gdb/infrun.c > index 181d961d80d..8ed538ea9ec 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -2748,8 +2748,6 @@ clear_proceed_status_thread (struct thread_info *tp) > > tp->control.stop_step = 0; > > - tp->control.proceed_to_finish = 0; > - > tp->control.stepping_command = 0; > > /* Discard any remaining commands or status from previous stop. */ > @@ -6737,31 +6735,28 @@ process_event_stop_test (struct execution_control_state *ecs) > > case BPSTAT_WHAT_STEP_RESUME: Something else that I failed to notice. Since you removed both comments that mention that this case is here for reverse finishing, there is no good way to figure out what GDB wants to do when this part of the code is reached. Adding a comment here mentioning it would fix that. > infrun_debug_printf ("BPSTAT_WHAT_STEP_RESUME"); > - > delete_step_resume_breakpoint (ecs->event_thread); > - if (ecs->event_thread->control.proceed_to_finish > - && execution_direction == EXEC_REVERSE) > + fill_in_stop_func (gdbarch, ecs); > + > + if (execution_direction == EXEC_REVERSE > + && ecs->event_thread->stop_pc () == ecs->stop_func_start) > { > struct thread_info *tp = ecs->event_thread; > + stop_pc_sal = find_pc_line (ecs->event_thread->stop_pc (), 0); > > - /* We are finishing a function in reverse, and just hit the > - step-resume breakpoint at the start address of the > - function, and we're almost there -- just need to back up > - by one more single-step, which should take us back to the > - function call. */ > - tp->control.step_range_start = tp->control.step_range_end = 1; > - keep_going (ecs); > - return; > - } > - fill_in_stop_func (gdbarch, ecs); > - if (ecs->event_thread->stop_pc () == ecs->stop_func_start > - && execution_direction == EXEC_REVERSE) > - { > - /* We are stepping over a function call in reverse, and just > - hit the step-resume breakpoint at the start address of > - the function. Go back to single-stepping, which should > - take us back to the function call. */ > - ecs->event_thread->stepping_over_breakpoint = 1; > + /* When setting a step range, need to call set_step_info > + to setup the current_line/symtab fields as well. */ > + set_step_info (tp, frame, stop_pc_sal); > + > + /* We are finishing a function in reverse or stepping over a function > + call in reverse, and just hit the step-resume breakpoint at the > + start address of the function, and we're almost there -- just need > + to back up to the function call. > + > + Return using a step range so we will keep stepping back to the > + first instruction in the source code line. */ > + tp->control.step_range_start = ecs->stop_func_start; > + tp->control.step_range_end = ecs->stop_func_start; > keep_going (ecs); > return; > } -- Cheers, Bruno