From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36144 invoked by alias); 17 Apr 2018 17:07:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 35873 invoked by uid 89); 17 Apr 2018 17:07:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=totally X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Apr 2018 17:07:39 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62BA6857EA; Tue, 17 Apr 2018 17:07:38 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id E55B57C31; Tue, 17 Apr 2018 17:07:37 +0000 (UTC) Subject: Re: [PATCH 31/40] target_ops/C++: Base FreeBSD target To: John Baldwin , gdb-patches@sourceware.org References: <20180414190953.24481-1-palves@redhat.com> <20180414190953.24481-32-palves@redhat.com> <2651054.rGX2nUqyEc@ralph.baldwin.cx> From: Pedro Alves Message-ID: <4c3b320e-ecbe-4e97-9ee4-91cacca60b8d@redhat.com> Date: Tue, 17 Apr 2018 17:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <2651054.rGX2nUqyEc@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-04/txt/msg00344.txt.bz2 On 04/17/2018 05:05 PM, John Baldwin wrote: > On Saturday, April 14, 2018 08:09:44 PM Pedro Alves wrote: >> The >> >> $architecture x NetBSD/OpenBSD/FreeBSD >> >> support matrix complicates things a bit. There's common BSD target >> code, and there's common architecture-specific code shared between the >> different BSDs. Current, all that is stiched together to form a final >> target, via the i386bsd_target, x86bsd_target, fbsd_nat_add_target >> functions etc. >> >> Introduces a fbsd_nat_target base/prototype target. To be used in >> following patches. > > I will do some tests of FreeBSD/amd64 first and let you know what I find. Thank you! > One small thing I noticed: > >> diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h >> index 8326b96db7..a4418bb8f8 100644 >> --- a/gdb/fbsd-nat.h >> +++ b/gdb/fbsd-nat.h >> + >> +#ifdef PL_FLAG_EXEC >> + int insert_exec_catchpoint (int) override; >> + int remove_exec_catchpoint (int) override; >> +#endif >> + >> +#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE >> + int set_syscall_catchpoint (int, bool, int, gdb::array_view) >> + override; >> +#endif /* HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE */ >> + >> +#endif /* PT_LWPINFO */ >> +}; > > Do we want to be consistent about whether or not to have comments for > #endif's? Most in this change don't but these two do. I think I have added the one for PT_LWPINFO thinking that the corresponding #ifdef is so far away, and then added the one just above too, while missing the others. I don't have a strong opinion on whether all should have the comment, I'm fine either way since the #ifdef blocks are small, i.e., removing the comment for HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE is totally fine with me and may even reduce noise. I do think the comment for "#endif PT_LWPINFO" is beneficial, however. > > (Also, my initial impression is that the #ifdef's are more readable in this > version than the current code) > Yeah, the #endif for PT_LWPINFO is the one that I think I recall gave me pause in the current code. Thanks, Pedro Alves