From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id AFCA4385840E for ; Mon, 22 Nov 2021 19:24:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AFCA4385840E Received: from [2001:470:142:3::e] (port=47480 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpEvl-0006LA-OJ; Mon, 22 Nov 2021 14:24:49 -0500 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=52508 helo=dundal.janneke.lilypond.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpEvk-0003fT-S0; Mon, 22 Nov 2021 14:24:45 -0500 From: Jan Nieuwenhuizen To: Simon Marchi Cc: gdb@sourceware.org Subject: Re: [PATCH 3/3] gdb: More compile fixes for gnu-nat.c. Organization: AvatarAcademy.nl References: <20211122073057.19946-1-janneke@gnu.org> <9225658f-a554-1ac1-075b-a2f0ea289313@simark.ca> X-Url: http://AvatarAcademy.nl Date: Mon, 22 Nov 2021 20:24:42 +0100 In-Reply-To: <9225658f-a554-1ac1-075b-a2f0ea289313@simark.ca> (Simon Marchi's message of "Mon, 22 Nov 2021 10:17:13 -0500") Message-ID: <87a6hw56yt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2021 19:24:51 -0000 --=-=-= Content-Type: text/plain Simon Marchi writes: Hello Simon, > I only see patch 3/3, is it normal? Otherwise, patches should be sent > to the gdb-patches mailing list (same address, just with gdb-patches > instead of gdb). Ah, oops. Yeah, I was using two other patches on top of gdb-11-branch; one by you, cherry-pickef from master, and one sent to this list. I'm attaching them for completeness. Yes, I can send my patch to gdb-patches if that's helpful. >> * gdb/gnu-nat.c (add_task_commands): Use a fresh variable instead of >> shadowing set_signals_cmd etc. >> (add_thread_commands): Likewise. > > Note that we don't use ChangeLogs in gdb/. Okay, I see. Greetings, Janneke --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gdb-fix-gnu-nat-build.patch >From 30d89407ad6bb62fafc72fa9c547c2d7ff371401 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 3 Nov 2021 15:09:19 -0400 Subject: [PATCH 1/3] gdb: fix gnu-nat build Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 When building gnu-nat.c, we get: CXX gnu-nat.o gnu-nat.c: In member function 'virtual void gnu_nat_target::create_inferior(const char*, const string&, char**, int)': gnu-nat.c:2117:13: error: 'struct inf' has no member named 'target_is_pushed' 2117 | if (!inf->target_is_pushed (this)) | ^~~~~~~~~~~~~~~~ gnu-nat.c:2118:10: error: 'struct inf' has no member named 'push_target' 2118 | inf->push_target (this); | ^~~~~~~~~~~ This is because of a confusion between the generic `struct inferior` variable and the gnu-nat-specific `struct inf` variable. Fix by referring to `inferior`, not `inf`. Adjust the comment on top of `struct inf` to clarify the purpose of that type. Co-Authored-By: Andrea Monaco Change-Id: I2fe2f7f6ef61a38d79860fd262b08835c963fc77 --- gdb/gnu-nat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 67ce00e9c30..ab539b4d8b4 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -149,7 +149,7 @@ struct inf_wait int suppress; /* Something trivial happened. */ }; -/* The state of an inferior. */ +/* Further Hurd-specific state of an inferior. */ struct inf { /* Fields describing the current inferior. */ @@ -2114,8 +2114,8 @@ gnu_nat_target::create_inferior (const char *exec_file, inf_debug (inf, "creating inferior"); - if (!inf->target_is_pushed (this)) - inf->push_target (this); + if (!inferior->target_is_pushed (this)) + inferior->push_target (this); pid = fork_inferior (exec_file, allargs, env, gnu_ptrace_me, NULL, NULL, NULL, NULL); --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-gdb-gnu-nat.c-port-rights.patch >From ebc0837f4693232f74eb2cc3033515b18a8f0900 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Mon, 22 Nov 2021 07:47:28 +0100 Subject: [PATCH 2/3] gdb: gnu-nat.c: port-rights. Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Taken from: https://sourceware.org/pipermail/gdb/2021-November/049777.html --- gdb/gnu-nat.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index ab539b4d8b4..8cd876b21d0 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -3292,15 +3292,17 @@ This is the same as setting `task pause', `exceptions', and\n\ _("Show information about the task's send rights.")); add_info ("receive-rights", info_recv_rights_cmd, _("Show information about the task's receive rights.")); - add_info ("port-rights", info_port_rights_cmd, - _("Show information about the task's port rights.")); - add_info ("port-sets", info_port_sets_cmd, - _("Show information about the task's port sets.")); + cmd_list_element *port_rights_cmd = + add_info ("port-rights", info_port_rights_cmd, + _("Show information about the task's port rights.")); + cmd_list_element *port_sets_cmd = + add_info ("port-sets", info_port_sets_cmd, + _("Show information about the task's port sets.")); add_info ("dead-names", info_dead_names_cmd, - _("Show information about the task's dead names.")); - add_info_alias ("ports", "port-rights", 1); - add_info_alias ("port", "port-rights", 1); - add_info_alias ("psets", "port-sets", 1); + _("Show information about the task's dead names.")); + add_info_alias ("ports", port_rights_cmd, 1); + add_info_alias ("port", port_rights_cmd, 1); + add_info_alias ("psets", port_sets_cmd, 1); } --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com --=-=-=--