[Kde-bindings] KDE/kdebindings/generator/generators/smoke
David Palacio
dpalacio at uninorte.edu.co
Tue Jul 6 10:43:31 UTC 2010
On Lunes 05 Julio 2010 10:01:29 Arno Rehn wrote:
> SVN commit 1146237 by arnorehn:
>
> make x_classes inherit from __internal_SmokeClass to flag them as a smoke
> class. Then use a dynamic_cast<__internal_SmokeClass*> to check whether a
> class was created by smoke or not. this will increase the overhead, but
> it's the only alternative to adding all inherited virtual methods to the
> smoke classes.
>
> Fixes bug reported by Stefano Crocco. Thanks for reporting!
>
> CCMAIL: kde-bindings at kde.org
>
> M +6 -3 writeClasses.cpp
>
>
> --- trunk/KDE/kdebindings/generator/generators/smoke/writeClasses.cpp
> #1146236:1146237 @@ -80,6 +80,8 @@
>
> fileOut << "\n#include <smoke.h>\n#include <" << Options::module
> << "_smoke.h>\n";
>
> + fileOut << "\nclass __internal_SmokeClass { public: virtual
> ~__internal_SmokeClass() {} };\n"; +
> fileOut << "\nnamespace __smoke" << Options::module << " {\n\n";
>
> // now the class code
> @@ -194,7 +196,7 @@
> } else {
> // This is a virtual method. To know whether we should call with
> dynamic dispatch, we need a bit of RTTI magic.
> includes.insert("typeinfo");
> - out << " if (typeid(*this) == typeid(" << smokeClassName <<
> ")) {\n"; // + out << " if
> (dynamic_cast<__internal_SmokeClass*>(static_cast<" << className <<
> "*>(this))) {\n"; // out << generateMethodBody(" ", //
> indent
> className, smokeClassName, meth, index,
> false, includes); out << " } else {\n";
> @@ -363,8 +365,9 @@
> QTextStream switchOut(&switchCode);
>
> out << QString("class %1").arg(smokeClassName);
> - if (!klass->isNameSpace())
> - out << QString(" : public %1").arg(className);
> + if (!klass->isNameSpace()) {
> + out << QString(" : public %1, public
> __internal_SmokeClass").arg(className); + }
> out << " {\n";
> if (Util::canClassBeInstanciated(klass)) {
> out << " SmokeBinding* _binding;\n";
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings at kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings
With this change, a Korundum application and a plasmoid, segfault at startup.
"stealt-cashew" backtrace in plasmoidviewer:
#6 Plasma::Package::path (this=0x9e8f08) at
/home/kde/src/KDE/kdelibs/plasma/package.cpp:170
#7 0x00007f3fa0aca091 in __smokeplasma::x_Plasma__Package::x_9 (xi=<value
optimized out>, obj=0x9e8f00, args=0xbb0480) at
/home/kde/build/KDE/kdebindings/smoke/plasma/x_6.cpp:2256
#8 __smokeplasma::xcall_Plasma__Package (xi=<value optimized out>,
obj=0x9e8f00, args=0xbb0480) at
/home/kde/build/KDE/kdebindings/smoke/plasma/x_6.cpp:2318
#9 0x00007f3fa2dbd83d in QtRuby::MethodCall::callMethod (this=0x7fff5b859a40)
at /home/kde/src/KDE/kdebindings/ruby/qtruby/src/marshall_types.h:148
#10 0x00007f3fa2dbb7ba in QtRuby::MethodCallBase::next (this=0x7fff5b859a40) at
/home/kde/src/KDE/kdebindings/ruby/qtruby/src/marshall_types.cpp:466
#11 0x00007f3fa2d87803 in method_missing (argc=1, argv=0x7fff5b859fa0,
self=139911200750000) at
/home/kde/src/KDE/kdebindings/ruby/qtruby/src/Qt.cpp:937
#12 0x00007f3fa3006c06 in rb_call0 () from /usr/lib/libruby18.so.1.8
#13 0x00007f3fa3006dbd in rb_call () from /usr/lib/libruby18.so.1.8
#14 0x00007f3fa30076d3 in rb_funcall2 () from /usr/lib/libruby18.so.1.8
#15 0x00007f3fa300f1ed in method_missing () from /usr/lib/libruby18.so.1.8
#16 0x00007f3fa3006e6b in rb_call () from /usr/lib/libruby18.so.1.8
#17 0x00007f3fa3001138 in rb_eval () from /usr/lib/libruby18.so.1.8
#18 0x00007f3fa3003b02 in rb_eval () from /usr/lib/libruby18.so.1.8
#19 0x00007f3fa3001056 in rb_eval () from /usr/lib/libruby18.so.1.8
#20 0x00007f3fa3003a12 in rb_eval () from /usr/lib/libruby18.so.1.8
#21 0x00007f3fa300240a in rb_eval () from /usr/lib/libruby18.so.1.8
#22 0x00007f3fa3006b20 in rb_call0 () from /usr/lib/libruby18.so.1.8
#23 0x00007f3fa3006dbd in rb_call () from /usr/lib/libruby18.so.1.8
#24 0x00007f3fa30076d3 in rb_funcall2 () from /usr/lib/libruby18.so.1.8
#25 0x00007f3fa2ffd269 in rb_protect () from /usr/lib/libruby18.so.1.8
#26 0x00007f3fa2dbca1f in QtRuby::VirtualMethodCall::callMethod
(this=0x7fff5b85b8e0) at
/home/kde/src/KDE/kdebindings/ruby/qtruby/src/marshall_types.cpp:523
#27 0x00007f3fa2dbb7ba in QtRuby::MethodCallBase::next (this=0x7fff5b85b8e0) at
/home/kde/src/KDE/kdebindings/ruby/qtruby/src/marshall_types.cpp:466
#28 0x00007f3fa2d839a0 in QtRuby::Binding::callMethod (this=0x7f3fa0f61340,
method=<value optimized out>, ptr=0xa56c70, args=0x7fff5b85b980)
at /home/kde/src/KDE/kdebindings/ruby/qtruby/src/Qt.cpp:304
#29 0x00007f3fa0aa0550 in __smokeplasma::x_Plasma__AppletScript::init
(this=0xa56c70) at /home/kde/build/KDE/kdebindings/smoke/plasma/x_2.cpp:2003
#30 0x00007f3fbd294a9d in Plasma::Applet::init (this=0x9dd740) at
/home/kde/src/KDE/kdelibs/plasma/applet.cpp:232
#31 0x00007f3fbd2ac0d9 in Plasma::Containment::addApplet (this=0x9c59c0,
applet=0x9dd740, pos=..., delayInit=false) at
/home/kde/src/KDE/kdelibs/plasma/containment.cpp:984
#32 0x0000000000407637 in FullView::addApplet (this=0x7fff5b85bdb0, name=...,
containment=<value optimized out>, wallpaper=..., args=...)
at
/home/kde/src/KDE/kdebase/workspace/plasma/generic/shells/plasmoidviewer/fullview.cpp:127
#33 0x000000000040c20a in main (argc=2, argv=0x7fff5b85c8d8) at
/home/kde/src/KDE/kdebase/workspace/plasma/generic/shells/plasmoidviewer/main.cpp:227
It is strange since stealth-cashew does not deal with Plasma packages
directly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20100706/d0fb5017/attachment.sig>
More information about the Kde-bindings
mailing list