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 1D0D6386F80C for ; Thu, 21 May 2020 14:12:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1D0D6386F80C 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 [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (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 64C9C1E072; Thu, 21 May 2020 10:12:28 -0400 (EDT) Subject: Re: gdb-9.1 Fails to build: "invalid cast to abstract class type" To: Chris Nicol , gdb@sourceware.org References: <052613da-fdbe-707b-3a52-da7ce437d424@uleth.ca> From: Simon Marchi Message-ID: <1b20f6d8-9736-02d8-73dc-bc4843e36ed3@simark.ca> Date: Thu, 21 May 2020 10:12:27 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <052613da-fdbe-707b-3a52-da7ce437d424@uleth.ca> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_ASCII_DIVIDERS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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@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: Thu, 21 May 2020 14:12:30 -0000 On 2020-05-20 2:24 p.m., Chris Nicol wrote: > Hello, > > I am trying to build a new version of the debugger on a SunBlade 100 running FreeBSD 12.1. This build fails with the following complaint: > >   CXX    sparc64-fbsd-nat.o > In file included from ../../gdb/sparc64-fbsd-nat.c:26: > ../../gdb/sparc-nat.h: In instantiation of 'target_xfer_status sparc_target::xfer_partial(target_object, const char*, gdb_byte*, const gdb_byte*, ULONGEST, ULONGEST, ULONGEST*) [with BaseTarget = fbsd_nat_target; gdb_byte = unsigned char; ULONGEST = long unsigned int]': > ../../gdb/sparc-nat.h:67:27:   required from here > ../../gdb/sparc-nat.h:78:12: error: invalid cast to abstract class type 'fbsd_nat_target' >    78 |     return BaseTarget (object, annex, readbuf, writebuf, >       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >    79 |          offset, len, xfered_len); >       |          ~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from ../../gdb/sparc64-fbsd-nat.c:24: > ../../gdb/fbsd-nat.h:36:7: note:   because the following virtual functions are pure within 'fbsd_nat_target': >    36 | class fbsd_nat_target : public inf_ptrace_target >       |       ^~~~~~~~~~~~~~~ > In file included from ../../gdb/inf-ptrace.h:23, >                  from ../../gdb/fbsd-nat.h:23, >                  from ../../gdb/sparc64-fbsd-nat.c:24: > ../../gdb/inf-child.h:42:8: note:     'virtual void inf_child_target::fetch_registers(regcache*, int)' >    42 |   void fetch_registers (struct regcache *, int) override = 0; >       |        ^~~~~~~~~~~~~~~ > ../../gdb/inf-child.h:43:8: note:     'virtual void inf_child_target::store_registers(regcache*, int)' >    43 |   void store_registers (struct regcache *, int) override = 0; >       |        ^~~~~~~~~~~~~~~ > gmake[2]: *** [Makefile:1656: sparc64-fbsd-nat.o] Error 1 > gmake[2]: Leaving directory '/usr/home/nicolc/gdb/gdb-9.1/build/gdb' > gmake[1]: *** [Makefile:9563: all-gdb] Error 2 > gmake[1]: Leaving directory '/usr/home/nicolc/gdb/gdb-9.1/build' > gmake: *** [Makefile:851: all] Error 2 > > > Can anyone provide insight into what is going on here, please? Thank you. > > Chris. > --  > ______________________________________________________________________ > This has been fixed by this commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c6a42d11acf2d485bf70d76eda76fd005fcd6825 So if you use the master branch, you shouldn't see this error. GDB 9.2 (the bugfix release of 9.1) will be out soon, we could probably cherry-pick that commit in that branch if that helps you. Simon