public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdb cannot print object casted to a pointer of certain class
@ 2005-11-03  0:04 Sp3cial K
  2005-11-03 21:22 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Sp3cial K @ 2005-11-03  0:04 UTC (permalink / raw)
  To: gdb

Has anyone encountered a problem where ptype prints out the class info in 
most frames, but it complaints "Type xxx has no component named xxx." in one 
frame?  Ironically, the frame where it doesn't print out correctly is in a 
function of that class!

Also, when I tried to print out an object casted to that class, as follows:
p *(xxx *)0x12345678
it complains:
A parse error in expression, near `)0x12345678'

But if I switch to another frame, then it prints out fine...

Any help will be greatly appreciated!

Thanks,

Special K


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gdb cannot print object casted to a pointer of certain class
  2005-11-03  0:04 gdb cannot print object casted to a pointer of certain class Sp3cial K
@ 2005-11-03 21:22 ` Daniel Jacobowitz
  2005-11-08  0:04   ` Sp3cial K
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2005-11-03 21:22 UTC (permalink / raw)
  To: Sp3cial K; +Cc: gdb

On Wed, Nov 02, 2005 at 07:04:45PM -0500, Sp3cial K wrote:
> Has anyone encountered a problem where ptype prints out the class info in 
> most frames, but it complaints "Type xxx has no component named xxx." in 
> one frame?  Ironically, the frame where it doesn't print out correctly is 
> in a function of that class!

The more details you snip out of a bug report, the less likely it is
that we can help you.  But I believe I know what this problem is:

> Also, when I tried to print out an object casted to that class, as follows:
> p *(xxx *)0x12345678
> it complains:
> A parse error in expression, near `)0x12345678'

The name is being interpreted differently in that scope, probably as
the constructor rather than the class.  A testcase might let us fix
this.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gdb cannot print object casted to a pointer of certain class
  2005-11-03 21:22 ` Daniel Jacobowitz
@ 2005-11-08  0:04   ` Sp3cial K
  0 siblings, 0 replies; 3+ messages in thread
From: Sp3cial K @ 2005-11-08  0:04 UTC (permalink / raw)
  To: drow; +Cc: gdb

I dont have the code with me right now.  What I remember is that the class 
has a valid constructor, and it works fine if I add "class" in front of the 
name to force it to be read as a class.  Do you think this is the frame or 
symbol table problem?



>From: Daniel Jacobowitz <drow@false.org>
>To: Sp3cial K <ikiwibebe@hotmail.com>
>CC: gdb@sources.redhat.com
>Subject: Re: gdb cannot print object casted to a pointer of certain class
>Date: Thu, 3 Nov 2005 16:22:18 -0500
>
>On Wed, Nov 02, 2005 at 07:04:45PM -0500, Sp3cial K wrote:
> > Has anyone encountered a problem where ptype prints out the class info 
>in
> > most frames, but it complaints "Type xxx has no component named xxx." in
> > one frame?  Ironically, the frame where it doesn't print out correctly 
>is
> > in a function of that class!
>
>The more details you snip out of a bug report, the less likely it is
>that we can help you.  But I believe I know what this problem is:
>
> > Also, when I tried to print out an object casted to that class, as 
>follows:
> > p *(xxx *)0x12345678
> > it complains:
> > A parse error in expression, near `)0x12345678'
>
>The name is being interpreted differently in that scope, probably as
>the constructor rather than the class.  A testcase might let us fix
>this.
>
>--
>Daniel Jacobowitz
>CodeSourcery, LLC


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-08  0:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-03  0:04 gdb cannot print object casted to a pointer of certain class Sp3cial K
2005-11-03 21:22 ` Daniel Jacobowitz
2005-11-08  0:04   ` Sp3cial K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).