From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 9791E3844046 for ; Tue, 28 Jul 2020 13:31:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9791E3844046 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3B79F1E794; Tue, 28 Jul 2020 09:31:09 -0400 (EDT) Subject: Re: [PATCH] Make target_wait options use enum flags To: Tom Tromey , gdb-patches@sourceware.org References: <20200727173526.2186755-1-tromey@adacore.com> From: Simon Marchi Message-ID: Date: Tue, 28 Jul 2020 09:31:03 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200727173526.2186755-1-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 28 Jul 2020 13:31:19 -0000 On 2020-07-27 1:35 p.m., Tom Tromey wrote: > This changes TARGET_WNOHANG to be a member of an enum, rather than a > define, and also adds a DEF_ENUM_FLAGS_TYPE for this type. Then, it > changes target_wait and the various target wait methods to use this > type rather than "int". > > This didn't catch any bugs, but it seems like a decent cleanup > nevertheless. > > I did not change deprecated_target_wait_hook, since that's only used > out-of-tree (by Insight), and there didn't seem to be a need. > > I can't build some of these targets, so I modified them on a > best-effort basis. I don't think this patch should go in before the > release branch is made. > > gdb/ChangeLog > 2020-07-27 Tom Tromey > > * windows-nat.c (struct windows_nat_target) : Update. > (windows_nat_target::wait): Update. > * target/wait.h (enum target_wait_flag): New. Use > DEF_ENUM_FLAGS_TYPE. > * target/target.h (target_wait): Change type of options. > * target.h (target_options_to_string, default_target_wait): > Update. > (struct target_ops) : Change type of options. > * target.c (target_wait, default_target_wait, do_option): Change > type of "options". > (target_options_to_string): Likewise. > * target-delegates.c: Rebuild. > * target-debug.h (target_debug_print_target_wait_flags): Rename > from target_debug_print_options. > * sol-thread.c (class sol_thread_target) : Update. > (sol_thread_target::wait): Update. > * rs6000-nat.c (class rs6000_nat_target) : Update. > (rs6000_nat_target::wait): Update. > * remote.c (class remote_target) : > Update. > (remote_target::wait_ns, remote_target::wait_as): Change type of > "options". > (remote_target::wait): Update. > * remote-sim.c (struct gdbsim_target) : Update. > (gdbsim_target::wait): Update. > * record-full.c (class record_full_base_target) : Update. > (record_full_wait_1): Change type of "options". > (record_full_base_target::wait): Update. > * record-btrace.c (class record_btrace_target) : Update. > (record_btrace_target::wait): Update. > * ravenscar-thread.c (struct ravenscar_thread_target) : > Update. > (ravenscar_thread_target::wait): Update. > * procfs.c (class procfs_target) : Update. > (procfs_target::wait): Update. > * obsd-nat.h (class obsd_nat_target) : Update. > * obsd-nat.c (obsd_nat_target::wait): Update. > * nto-procfs.c (struct nto_procfs_target) : Update. > (nto_procfs_target::wait): Update. > * nbsd-nat.h (struct nbsd_nat_target) : Update. > * nbsd-nat.c (nbsd_wait): Change type of "options". > (nbsd_nat_target::wait): Update. > * linux-thread-db.c (class thread_db_target) : Update. > (thread_db_target::wait): Update. > * linux-nat.h (class linux_nat_target) : Update. > * linux-nat.c (linux_nat_target::wait): Update. > * infrun.c (do_target_wait_1, do_target_wait): Change type of > "options". > * inf-ptrace.h (struct inf_ptrace_target) : Update. > * inf-ptrace.c (inf_ptrace_target::wait): Update. > * go32-nat.c (struct go32_nat_target) : Update. > (go32_nat_target::wait): Update. > * gnu-nat.h (struct gnu_nat_target) : Update. > * gnu-nat.c (gnu_nat_target::wait): Update. > * fbsd-nat.h (class fbsd_nat_target) : Update. > * fbsd-nat.c (fbsd_nat_target::wait): Update. > * darwin-nat.h (class darwin_nat_target) : Update. > * darwin-nat.c (darwin_nat_target::wait): Update. > * bsd-uthread.c (struct bsd_uthread_target) : Update. > (bsd_uthread_target::wait): Update. > * aix-thread.c (class aix_thread_target) : Update. > (aix_thread_target::wait): Update. > > gdbserver/ChangeLog > 2020-07-27 Tom Tromey > > * win32-low.h (class win32_process_target) : Update. > * win32-low.cc (win32_process_target::wait): Update. > * target.h (class process_stratum_target) : Update. > (mywait): Update. > * target.cc (mywait, target_wait): Change type of "options". > * linux-low.h (class linux_process_target) : Update. > * linux-low.cc (linux_process_target::wait): Update. Good idea thanks. For mostly mechanical changes across the code base like this, I think it should be fine to have a short ChangeLog entry that says "Update all users" or "Update all extenders". Otherwise, writing the ChangeLog entry really becomes a demotivation for making good code cleanups that have concrete positive impacts on the technical debt. Simon