From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61591 invoked by alias); 20 Aug 2018 15:03:20 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 61579 invoked by uid 89); 20 Aug 2018 15:03:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=wild X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Aug 2018 15:03:18 +0000 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 w7KF3BaD024070 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 20 Aug 2018 11:03:16 -0400 Received: by simark.ca (Postfix, from userid 112) id 99CB11EA9D; Mon, 20 Aug 2018 11:03:11 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id C05C41E012; Mon, 20 Aug 2018 11:03:10 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 20 Aug 2018 15:03:00 -0000 From: Simon Marchi To: Viesturs Veckalns Cc: gdb@sourceware.org Subject: Re: GDB support: Couldn't find method In-Reply-To: <3FAD73755234DA45BB9E7CAA811E9CB70102A57FD6@CERNXCHG73.cern.ch> References: <3FAD73755234DA45BB9E7CAA811E9CB70102A57F27@CERNXCHG73.cern.ch>, <3FAD73755234DA45BB9E7CAA811E9CB70102A57FD6@CERNXCHG73.cern.ch> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00043.txt.bz2 On 2018-08-08 07:14, Viesturs Veckalns wrote: > Hello Simon, > It turns out gdb does not know anything about class methods and nested > classes loaded from the shared library: > > (gdb) ptype GetLevel(resultcode) > type = struct CompoundHistoUnfolding::Level { > > } * > (gdb) ptype CompoundHistoUnfolding::Level > There is no field named Level > > gdb can list members of class CompoundHistoUnfolding but does not know > about classes interfaced with the #include directive: > > (gdb) ptype CompoundHistoUnfolding > type = class CompoundHistoUnfolding : public TNamed { > private: > Python Exception No type named TString.: > std::map, > std::allocator > > > aggrbackgroundMC; > Python Exception No type named HistoUnfolding*.: > std::vector > > _vbackgroundhistos; > Python Exception No type named SampleDescriptor*.: > std::vector > > _expsyssamples; > std::vector > > _markedsyssamples; > HistoUnfoldingTH2 *totalbackground; > char _signal_title[64]; > ... > > How to proceed from this point? > Viesturs I tried this simple code, and everything works as expected: --- class Outer { class Inner { int foo = 2; public: int getFoo() { return foo; } }; public: Inner getBar() { return Inner(); } }; int main() { Outer o; return o.getBar().getFoo(); } --- (gdb) p o.getBar().getFoo() $2 = 2 (gdb) ptype Outer::Inner type = class Outer::Inner { private: int foo; public: int getFoo(void); } To continue investigating, I would need a minimal reproducer, because at this point I can only do some very wild guessing. Simon