Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Viesturs Veckalns <viesturs.veckalns@cern.ch>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: RE: GDB support: Couldn't find method
Date: Wed, 08 Aug 2018 11:15:00 -0000	[thread overview]
Message-ID: <3FAD73755234DA45BB9E7CAA811E9CB70102A57FD6@CERNXCHG73.cern.ch> (raw)
In-Reply-To: <b2da156f75c89f511a605787b2baea2c@polymtl.ca>

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 {
    <incomplete type>
} *
(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 <class 'gdb.error'> No type named TString.: 
    std::map<TString, HistoUnfolding*, std::less<TString>, std::allocator<std::pair<TString const, HistoUnfolding*> > > aggrbackgroundMC;
Python Exception <class 'gdb.error'> No type named HistoUnfolding*.: 
    std::vector<HistoUnfolding*, std::allocator<HistoUnfolding*> > _vbackgroundhistos;
Python Exception <class 'gdb.error'> No type named SampleDescriptor*.: 
    std::vector<SampleDescriptor*, std::allocator<SampleDescriptor*> > _expsyssamples;
    std::vector<SampleDescriptor*, std::allocator<SampleDescriptor*> > _markedsyssamples;
    HistoUnfoldingTH2 *totalbackground;
    char _signal_title[64];
...

How to proceed from this point?
Viesturs
________________________________________
From: Simon Marchi [simon.marchi@polymtl.ca]
Sent: 08 August 2018 02:27
To: Viesturs Veckalns
Cc: gdb@sourceware.org
Subject: Re: GDB support: Couldn't find method

On 2018-08-04 07:48, Viesturs Veckalns wrote:
> Hello!
> I compile a binary by linking a library:
>
> -L${LIBDIR}/lib -lCompoundHisto
>
> In the debug session the library is listed under
>
> info sharedlibrary
>
> Additionally, I requested to read symbols from the relevant source
> files by
>
> set debug-file-directory ${LIBDIR}/interface
> set debug-file-directory ${LIBDIR}/src
>
> Nevertheless, I encounter the following problem:
>
> p GetLevel(resultcode) -> GetHU(mo)
> Couldn't find method CompoundHistoUnfolding::Level::GetHU
>
> The methods are described in the source to build libCompoundHisto.so
>
> What is wrong?
>
> My gdb version is 7.11.
> Viesturs

Hi Viesturs,

A sanity check to see if GDB knows about any GetHU method would to do

   (gdb) ptype GetLevel(resultcode)

or

   (gdb) ptype CompoundHistoUnfolding::Level

Do you see GetHU listed?

Simon


  reply	other threads:[~2018-08-08 11:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-04 11:48 Viesturs Veckalns
2018-08-08  0:27 ` Simon Marchi
2018-08-08 11:15   ` Viesturs Veckalns [this message]
2018-08-20 15:03     ` Simon Marchi
2018-08-20 15:13 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FAD73755234DA45BB9E7CAA811E9CB70102A57FD6@CERNXCHG73.cern.ch \
    --to=viesturs.veckalns@cern.ch \
    --cc=gdb@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox