From: jcorgan Date: Tue, 20 May 2008 18:56:10 +0000 (+0000) Subject: Expose flowgraph debugging dump as gr.top_block.dump(). May or may not be suitable... X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c7fc4e073aca82bc4cae529459448e0bc98b650e;p=debian%2Fgnuradio Expose flowgraph debugging dump as gr.top_block.dump(). May or may not be suitable for ticket:245 git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8466 221aa14e-8319-0410-a670-987f0aec2ac5 --- diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.cc b/gnuradio-core/src/lib/runtime/gr_top_block.cc index b2523afc..5cb0ccde 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_top_block.cc @@ -90,6 +90,12 @@ gr_top_block::unlock() d_impl->unlock(); } +void +gr_top_block::dump() +{ + d_impl->dump(); +} + bool gr_top_block::is_running() { diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.h b/gnuradio-core/src/lib/runtime/gr_top_block.h index 0209546f..637a3846 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.h +++ b/gnuradio-core/src/lib/runtime/gr_top_block.h @@ -99,6 +99,11 @@ public: */ virtual void unlock(); + /*! + * Displays flattened flowgraph edges and block connectivity + */ + void dump(); + /*! * Returns true if flowgraph is running */ diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i index f48dea74..d2e8e3b4 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.i +++ b/gnuradio-core/src/lib/runtime/gr_top_block.i @@ -47,6 +47,7 @@ public: void lock(); void unlock() throw (std::runtime_error); bool is_running(); + void dump(); }; %inline %{ diff --git a/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc b/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc index 51755a65..359665a7 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc +++ b/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc @@ -231,3 +231,10 @@ gr_top_block_impl::restart() start_threads(); } + +void +gr_top_block_impl::dump() +{ + if (d_ffg) + d_ffg->dump(); +} diff --git a/gnuradio-core/src/lib/runtime/gr_top_block_impl.h b/gnuradio-core/src/lib/runtime/gr_top_block_impl.h index 1868cffd..abdfa996 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block_impl.h +++ b/gnuradio-core/src/lib/runtime/gr_top_block_impl.h @@ -54,6 +54,9 @@ public: // Unlock the top block at end of reconfiguration void unlock(); + // Dump the flowgraph to stdout + void dump(); + // Return true if flowgraph is running bool is_running() const { return d_running; }