0

I have a debug build without sources to start with. ptype gives me the class definition with the prototype of methods declared in it.

(gdb) ptype A

type = class A : public B {

  private:

    int c;


  public:

    virtual void accept(Ivisitor &V);

    virtual int getItem(void) const;

}

How can I get the the definitions of methods accept() and getitem() in gdb ?

Please note I don't have the source with the debug build.

(gdb) l A::accept

Line 469 of "const.h" starts at address 0x433d9c <A::accept(Ivisitor>)> and ends at 0x433db1 <A::accept(Ivisitor>)+21>.
ks1322
  • 33,961
  • 14
  • 109
  • 164
Gopal
  • 11

1 Answers1

1

U can not view function definition without attaching a source code. Class definitions are seen as symbol table was loaded.

  • Yes. Debug build does information does not include source code. If you don't have it you cant display it. – dbrank0 Jan 19 '17 at 09:55