cast_object_to bug / PerlQt cvs compilation (Was Re: [Kde-bindings] [Bug 71316] QtRuby : Segmentation fault when loading Qt)

Richard Dale Richard_Dale at
Mon Jan 12 21:08:43 UTC 2004

On Monday 12 January 2004 18:26, Alexander Kellett wrote:
> On Monday 12 January 2004 03:52, Germain Garand wrote:
> > mmh, strange that it chokes during the Smoke compile... kalyptus is in
> > sync with HEAD.
> yeah. thats what i assumed. wierd. i'll look into it sometime this week
> and get back to you.
I updated the current kalyptus and smoke/kde with kdelibs, and it all built 
fine for me. BTW Alex for nitive spookers the wood is 'weird'.. :)

> > > anyone maybe how i can get a full debugging trace (i.e,
> > > the output of gdb blah; run; s; s; ... [until program
> > > completes/crashes]) out of gdb? i'm clueless wrt this.
> >
> > usually, I simply do
> > gdb perl
> > (gdb) run
> > *crash*
> > (gdb) bt
> at last i found out how to int 3 (breakpoint in x86 asm) with gcc/linux:
> its in Korundum.cpp, i also found this header on my system:
> 	/usr/include/glib-2.0/glib/gbacktrace.h
> maybe i should try and get a copy of this into kdecore at some point
> as its really a needed macro imo and i can't find it in either kde nor
> in qt itself...

> yeah. at first i copied this, well, the artistic equivalent anyway :)
> so, at first i just had Wrap_Data_Struct create a ruby variable VALUE
> with the given type name. which i think is more or less a equiv to
> perl's . but then. i read mapPointer in Korundum.cpp and started
> messing with all sorts of wierd stuff after that point. slowly making
> a mess of the code and getting no further. oh the fun :)
> > $>CAST( $a, "Qt::Utf8Codec")
> > $>print $a->mibEnum()."\n"
> > 106
Alex's example all seemed to work as expected when I tried it. I think the 
cast_to_object() is correct, even though the malloc'ing might need to be 
tidied up. And perhaps the method rename dynamic_cast(), and passed a Class 
as arg, rather than the classname as a String.

-- Richard

More information about the Kde-bindings mailing list