From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 0ABAE3858C27 for ; Wed, 3 Nov 2021 00:36:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0ABAE3858C27 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1A30Zw45024531 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 2 Nov 2021 20:36:03 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1A30Zw45024531 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 936E71E940; Tue, 2 Nov 2021 20:35:58 -0400 (EDT) Message-ID: <5d939c89-8816-50da-dc75-75869543c38f@polymtl.ca> Date: Tue, 2 Nov 2021 20:35:58 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: gdb 11.1: struct inf lacks two members Content-Language: en-US To: Andrea Monaco , gdb@sourceware.org References: <87h7cudufq.fsf@autistici.org> From: Simon Marchi In-Reply-To: <87h7cudufq.fsf@autistici.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 3 Nov 2021 00:35:58 +0000 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: Wed, 03 Nov 2021 00:36:15 -0000 On 2021-11-02 19:11, Andrea Monaco via Gdb wrote: > > Hello, > > > after a successful configure, gdb 11.1 fails to make in my GNU/Hurd > system with the following errors: > > > 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); > | ^~~~~~~~~~~ > > > and some others follow. I found out that struct inf (from gnu-nat.c) is > only defined in the GNU/Hurd target, but it lacks the target_is_pushed > and push_target members which are part of class inferior (from > inferior.h). Is this a syntax error? > > > > Let me know, > > Andrea Monaco > Oh, my bad I think. This should use the "inferior" variable, not inf. As you mentioned, there's a "struct inf" type only defined in gnu-nat, and I got confused with the two similar variables. The change below should fix it, can you confirm? diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 54838347f947..13afb3ed8b01 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2108,8 +2108,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);