From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xj56A0Bavl8ADgAAWB0awg (envelope-from ) for ; Wed, 25 Nov 2020 08:21:04 -0500 Received: by simark.ca (Postfix, from userid 112) id F40031F0AB; Wed, 25 Nov 2020 08:21:03 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 A84121E552 for ; Wed, 25 Nov 2020 08:21:03 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E148385802D; Wed, 25 Nov 2020 13:21:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E148385802D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1606310463; bh=apPH+KgD6CrT2/E5GVnNkPPxS2/m6lOPGPd/woTM9+Y=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=w4hUsT14psY+NGmRxiR79eoesebZ+q8LnYmQaQplqDGfE8lCayOsYwHvrRrhhzOrZ 6uRU4kOglTwuF9/fwenq07uH0oR7zD7qrLkpfeq4e7xpHqQ69rhKsVMSBy5GrAYogv 3jhjgUS7yr06jNWplXsI2iNAmWS39HgFocYZoxmU= Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id A9B4E385802D for ; Wed, 25 Nov 2020 13:21:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A9B4E385802D Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 71BAB2ED33B; Wed, 25 Nov 2020 08:21:00 -0500 (EST) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id gClBksBgd_wA; Wed, 25 Nov 2020 08:21:00 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 3D5D42ED33A; Wed, 25 Nov 2020 08:21:00 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 3D5D42ED33A X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2Mt1X4b2Kmmv; Wed, 25 Nov 2020 08:21:00 -0500 (EST) Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) by mail.efficios.com (Postfix) with ESMTPSA id 148F22ED330; Wed, 25 Nov 2020 08:20:59 -0500 (EST) Subject: Re: [PATCH 06/12] gdb: introduce status enum for displaced step prepare/finish To: Pedro Alves , gdb-patches@sourceware.org References: <20201110214614.2842615-1-simon.marchi@efficios.com> <20201110214614.2842615-7-simon.marchi@efficios.com> Message-ID: <339eee1d-e54b-b8e0-38d3-638a3ddd8540@efficios.com> Date: Wed, 25 Nov 2020 08:20:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: fr 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-11-24 8:30 p.m., Pedro Alves wrote: > On 11/10/20 9:46 PM, Simon Marchi via Gdb-patches wrote: >> +enum displaced_step_finish_status >> +{ >> + /* Either the instruction was stepped and fixed up, or the specified thread >> + wasn't executing a displaced step (in which case there's nothing to >> + finish). */ >> + DISPLACED_STEP_FINISH_STATUS_OK, >> + >> + /* The thread was executing a displaced step, but didn't complete it. */ >> + DISPLACED_STEP_FINISH_STATUS_NOT_EXECUTED, > > There's an ambiguity here that gave me pause -- the enumeration is > called "not executed", but the comment says "was executing". I'd suggest: > > /* The thread started a displaced step, but didn't complete it. */ Fixed. >> -/* If we displaced stepped an instruction successfully, adjust >> - registers and memory to yield the same effect the instruction would >> - have had if we had executed it at its original address, and return >> - 1. If the instruction didn't complete, relocate the PC and return >> - -1. If the thread wasn't displaced stepping, return 0. */ >> +/* If we displaced stepped an instruction successfully, adjust registers and >> + memory to yield the same effect the instruction would have had if we had >> + executed it at its original address, and return >> + DISPLACED_STEP_PREPARE_STATUS_OK. If the instruction didn't complete, >> + relocate the PC and return DISPLACED_STEP_PREPARE_STATUS_NOT_EXECUTED. > > DISPLACED_STEP_PREPARE_... -> DISPLACED_STEP_FINISH_... Fixed. > >> -static int >> + If the thread wasn't displaced stepping, return >> + DISPLACED_STEP_PREPARE_STATUS_OK as well.. */ > > Here too. Also, spurious double period "..". Fixed. Thanks, Simon