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

Germain Garand germain at ebooksfrance.org
Mon Jan 12 02:52:33 UTC 2004


Le Dimanche 11 Janvier 2004 19:16, Alexander Kellett a écrit :
> umm.. wierd subject for an email? ;-)
>
> On Sunday 11 January 2004 19:42, Richard Dale wrote:
> > This is good news that we have a fix - thanks for doing all the work
> > getting in going in the cvs - I was worried it was going to be DOA after
> > all the effort gone into it. 

yup, very nice hack!

[...]
> for the moment
> this is really not all that important imo as its just a speed
> optimisation and after first start (loading smokekde for
> the first time / after linking - which is very slow unfortunately
> due to the size of smokekde) we are already very fast
> in any case, around 1 second for my prototype of a
> khtml using browser.

100% ack. It really is quite fast. Not significantly slower than launching 
*any* KDE application, anyway :-}

>
> just noticed that germain also worked on a khtml based
> browser (just checked out PerlQt-3). 
> unfortunately PerlQt
> cvs doesn't seem to compile
>
> /home/alex/install/kde/include/qptrlist.h: In member function `void
>    QPtrList<type>::deleteItem(void*) [with type = KXMLGUIClient]':
> x_13.cpp:10171:   instantiated from here
> /home/alex/install/kde/include/qptrlist.h:150: invalid use of undefined
> type ` struct KXMLGUIClient'
> /home/alex/install/kde/include/kxmlguifactory.h:30: forward declaration of
> ` struct KXMLGUIClient'

mmh, strange that it chokes during the Smoke compile... kalyptus is in sync 
with HEAD.
Plus the configure check should find your installed libsmokekde and skip the 
compile (did you use --prefix?).

Anyway, I'm afraid the CVS is not much in up-to-date /wrt PerlKDE.
There is stuff I don't know how to place yet and SF is a pain when it comes to 
modifying a CVS structure. 

> 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 the_script.pl
*crash*
(gdb) bt

but valgrind is much more informative

> germain: have you got any CAST using examples?
>

PerlQt's cast is just a Perl reblessing of the object... it does
   sub CAST ($$) { bless $_[0], " $_[1]" }
the leading space being an internal frobnication specific to PerlQt,
so I really have no idea about the issue. Smoke is doing all the casting job.

e.g:
$>$a = Qt::TextCodec::codecForMib(106) # standard mib for utf8 codec
$>print $a->mibEnum()."\n" # pure virtual
--- No method to call for :
QTextCodec::mibEnum()
Closer candidates are :
static QTextCodec* QTextCodec::codecForMib(int)

at (eval 2) line 1.

$>CAST( $a, "Qt::Utf8Codec")
$>print $a->mibEnum()."\n"
106

HIH,
Germain

> tia,
> Alex
>
> p.s: the signature that sigrot chose is really on the mark




More information about the Kde-bindings mailing list