Review request: control flow graph plugin
Esben Mose Hansen
kde at mosehansen.dk
Sun Nov 8 17:31:36 UTC 2009
On Sunday 08 November 2009 17:45:28 Esben Mose Hansen wrote:
> On Friday 16 October 2009 23:02:23 Andreas Pakulat wrote:
> > Backtrace:
> > #0 agsubg (g=0x0, name=0xd076ee0 "cluster_Global Namespace") at
> > graph.c:306
> > #1 0xeb027dd8 in DotControlFlowGraph::foundRootNode (this=0xc752be0,
> > containers=QList = {...}, label="ControlFlo")
> > at /home/andreas/src/controlflowgraph/dotcontrolflowgraph.cpp:81
> > #2 0xeb016964 in DotControlFlowGraph::qt_metacall (this=0xc752be0,
> > _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x10260ad8)
> > at
> > /home/andreas/src/controlflowgraph/build/moc_dotcontrolflowgraph.cpp:89
> > #3 0xf696f88b in QMetaObject::metacall (object=0xc752be0,
> > cl=QMetaObject::InvokeMetaMethod, idx=6, argv=0x10260ad8)
> > at /home/andreas/src/kde-qt/src/corelib/kernel/qmetaobject.cpp:237
> > #4 0xf697ce29 in QMetaCallEvent::placeMetaCall (this=0xeebdc30,
> > object=0xc752be0)
> > at /home/andreas/src/kde-qt/src/corelib/kernel/qobject.cpp:562
>
> I can reproduce this now. The trick is to open a source file, put the
> cursor on a symbol and then add the tool view. I'll try to see if I can
> fix it. (Also bottling beer, so I am a bit below my usual blazing speed)
>
This patch fixes it, I think. A matter of a race: the signal/slot connection
were made before the graph was initialized.
Would it be indecent of me to commit this patch, a patch that removes a lot of
C-style casts, and finally a tab->space patch? I am not sure if this is
indecent for code that I do not (officially) maintain... Mainly I am worried
about the tab patch, since moving stuff across that patch generates a lot of
(useless) conflicts.
diff --git a/kdevcontrolflowgraphviewplugin.cpp
b/kdevcontrolflowgraphviewplugin.cpp
index de91ddc..f505bb6 100644
--- a/kdevcontrolflowgraphviewplugin.cpp
+++ b/kdevcontrolflowgraphviewplugin.cpp
@@ -446,13 +446,14 @@ void
KDevControlFlowGraphViewPlugin::configureDuchainControlFlow(DUChainControlF
duchainControlFlow->setUseShortNames(fileDialog->useShortNames());
duchainControlFlow->setDrawIncomingArcs(fileDialog->drawIncomingArcs());
+ dotControlFlowGraph->prepareNewGraph();
+
connect(duchainControlFlow, SIGNAL(foundRootNode(const QStringList &,
const QString &)),
dotControlFlowGraph, SLOT (foundRootNode(const QStringList &,
const QString &)));
connect(duchainControlFlow, SIGNAL(foundFunctionCall(const QStringList
&, const QString &, const QStringList &, const QString &)),
dotControlFlowGraph, SLOT (foundFunctionCall(const QStringList
&, const QString &, const QStringList &, const QString &)));
connect(duchainControlFlow, SIGNAL(clearGraph()), dotControlFlowGraph,
SLOT(clearGraph()));
- dotControlFlowGraph->prepareNewGraph();
}
--
Kind regards, Esben
More information about the KDevelop-devel
mailing list