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.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 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=1673624541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fOtT6zyGTluiFpDiLWhW25RB5U0ZiFBv/U4yry0qakk=; b=NBf8sn7Vlx6p2BK7SkzJ4uej/mbvU7HgSR+nYP3PzrndWwClttUdIankA/H4KZOaZpBknp OZdDt8UGRj8yMGyy3o1n18TZ0FJKQV4AdhuFpOZIqWvcIwQQ5x3kdgwxrOOBWWK5OJ7Qch uJnTLm323QBotePEw+85vHbVaw5vOtQ= 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> From: Bruno Larsen 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-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham 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 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