🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #553

print object fails

#553
From: Paul Vaughan
Date: Fri, 11 Dec 1992 23:09
46 lines
1576 bytes
Setting print object on does not accomplish anything for me. Does it
work? I searched in the manual for "print object" and found no
disclaimers.

This is gdb 4.7 on a Sun Sparc 2 (both host and target), SunOS 4.1,
SUN CC compiled program under test, with help from cback version 2.05.

There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.7, Copyright 1992 Free Software Foundation, Inc...
(gdb) break fiz
Breakpoint 1 at 0x22ec: file trash.cc, line 20.
(gdb) run
Starting program: /home/vaughan/trilogy/engine/src/trash 

Breakpoint 1, fiz (b=0xf7fff8c4) at trash.cc:20
(gdb) set print object on
(gdb) show print object
Printing of object's derived type based on vtable info is on.
(gdb) print b
$1 = (struct Base *) 0xf7fff8c4            <------------ shouldn't this be Foo*?

--------------------------------trash.cc----------------------------------------
class Base {
public:
	virtual void fuz(int);
};


class Foo : public Base {
public:
	virtual void fuz(int);
};

void fiz(Base*);

void main () { 
	Foo foo;
	fiz(&foo);
}

void fiz(Base* b) {
	b->fuz(3);
}

void Base::fuz(int) {}
void Foo::fuz(int) {}
Technical Details
Message-ID: <9212112309.AA12362@Trilogy.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!trilogy.com!vaughan

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!trilogy.com!vaughan
From: vaughan@trilogy.com (Paul Vaughan)
Subject: print object fails
Message-ID: <9212112309.AA12362@Trilogy.COM>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 11 Dec 1992 23:09:44 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 47