make boost shared_ptr debugging a little easier to turn on/off

This commit is contained in:
Paul Davis 2016-05-07 13:32:31 -04:00
parent 2f9d5077dc
commit a232673454
11 changed files with 68 additions and 44 deletions

View File

@ -42,6 +42,7 @@
#include "ardour/audio_track.h"
#include "ardour/audioregion.h"
#include "ardour/boost_debug.h"
#include "ardour/dB.h"
#include "ardour/location.h"
#include "ardour/midi_region.h"

View File

@ -0,0 +1,39 @@
/*
Copyright (C) 2016 Paul Davis
From an idea by Carl Hetherington.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __libardour_boost_debug_h__
#define __libardour_boost_debug_h__
#include "pbd/boost_debug.h"
/* these defines are intended to be switched on as-needed. They will not work
unless the program was configured with --boost-sp-debug
*/
//#define BOOST_MARK_ROUTE(p) boost_debug_shared_ptr_mark_interesting((p).get(),"Route")
//#define BOOST_MARK_TRACK(p) boost_debug_shared_ptr_mark_interesting((p).get(),"Track")
//#define BOOST_SHOW_POINTERS() boost_debug_list_ptrs()
#define BOOST_MARK_ROUTE(p)
#define BOOST_MARK_TRACK(p)
#define BOOST_SHOW_POINTERS()
#endif /* __libardour_boost_debug_h__ */

View File

@ -19,7 +19,6 @@
#include <boost/scoped_array.hpp>
#include "pbd/boost_debug.h"
#include "pbd/enumwriter.h"
#include "pbd/error.h"
@ -30,6 +29,7 @@
#include "ardour/audio_diskstream.h"
#include "ardour/audio_track.h"
#include "ardour/audioplaylist.h"
#include "ardour/boost_debug.h"
#include "ardour/buffer_set.h"
#include "ardour/delivery.h"
#include "ardour/meter.h"

View File

@ -20,8 +20,8 @@
#include "pbd/error.h"
#include "pbd/convert.h"
#include "pbd/compose.h"
#include "pbd/boost_debug.h"
#include "ardour/boost_debug.h"
#include "ardour/debug.h"
#include "ardour/automation_control.h"
#include "ardour/automation_list.h"

View File

@ -32,7 +32,6 @@
#include <glibmm.h>
#include "pbd/cartesian.h"
#include "pbd/boost_debug.h"
#include "pbd/convert.h"
#include "pbd/error.h"
#include "pbd/failed_constructor.h"
@ -43,6 +42,7 @@
#include "ardour/audio_buffer.h"
#include "ardour/audioengine.h"
#include "ardour/boost_debug.h"
#include "ardour/buffer_set.h"
#include "ardour/debug.h"
#include "ardour/pannable.h"

View File

@ -33,7 +33,6 @@
#include "pbd/memento_command.h"
#include "pbd/stacktrace.h"
#include "pbd/convert.h"
#include "pbd/boost_debug.h"
#include "pbd/unwind.h"
#include "ardour/amp.h"
@ -41,6 +40,7 @@
#include "ardour/audio_track.h"
#include "ardour/audio_port.h"
#include "ardour/audioengine.h"
#include "ardour/boost_debug.h"
#include "ardour/buffer.h"
#include "ardour/buffer_set.h"
#include "ardour/capturing_processor.h"

View File

@ -21,9 +21,9 @@
#include <algorithm>
#include "pbd/xml++.h"
#include "pbd/boost_debug.h"
#include "ardour/amp.h"
#include "ardour/boost_debug.h"
#include "ardour/buffer_set.h"
#include "ardour/debug.h"
#include "ardour/gain_control.h"

View File

@ -36,7 +36,6 @@
#include <boost/algorithm/string/erase.hpp>
#include "pbd/basename.h"
#include "pbd/boost_debug.h"
#include "pbd/convert.h"
#include "pbd/convert.h"
#include "pbd/error.h"
@ -59,6 +58,7 @@
#include "ardour/audioengine.h"
#include "ardour/audiofilesource.h"
#include "ardour/auditioner.h"
#include "ardour/boost_debug.h"
#include "ardour/buffer_manager.h"
#include "ardour/buffer_set.h"
#include "ardour/bundle.h"
@ -785,9 +785,7 @@ Session::destroy ()
DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n");
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
boost_debug_list_ptrs ();
#endif
BOOST_SHOW_POINTERS ();
}
void
@ -1147,9 +1145,8 @@ Session::add_monitor_section ()
return;
}
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (r.get(), "Route");
#endif
BOOST_MARK_ROUTE(r);
try {
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
r->input()->ensure_io (_master_out->output()->n_ports(), false, this);
@ -2458,9 +2455,8 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost:
track->use_new_diskstream();
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (track.get(), "Track");
#endif
BOOST_MARK_TRACK (track);
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
if (track->input()->ensure_io (input, false, this)) {
@ -2558,9 +2554,8 @@ Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name
bus->set_strict_io (true);
}
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (bus.get(), "Route");
#endif
BOOST_MARK_ROUTE(bus);
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
@ -2985,9 +2980,8 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
track->use_new_diskstream();
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (track.get(), "Track");
#endif
BOOST_MARK_TRACK (track);
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
@ -3082,9 +3076,8 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r
bus->set_strict_io (true);
}
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (bus.get(), "Route");
#endif
BOOST_MARK_ROUTE(bus);
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
@ -3564,7 +3557,6 @@ Session::add_internal_send (boost::shared_ptr<Route> dest, boost::shared_ptr<Pro
graph_reordered ();
}
void
Session::remove_routes (boost::shared_ptr<RouteList> routes_to_remove)
{

View File

@ -19,8 +19,8 @@
#include "pbd/demangle.h"
#include "pbd/error.h"
#include "pbd/boost_debug.h"
#include "ardour/boost_debug.h"
#include "ardour/session.h"
#include "ardour/session_handle.h"

View File

@ -61,7 +61,6 @@
#include "evoral/SMF.hpp"
#include "pbd/boost_debug.h"
#include "pbd/basename.h"
#include "pbd/controllable_descriptor.h"
#include "pbd/debug.h"
@ -83,6 +82,7 @@
#include "ardour/audiofilesource.h"
#include "ardour/audioregion.h"
#include "ardour/automation_control.h"
#include "ardour/boost_debug.h"
#include "ardour/butler.h"
#include "ardour/control_protocol_manager.h"
#include "ardour/directory_names.h"
@ -637,10 +637,10 @@ Session::create (const string& session_template, BusProfile* bus_profile)
if (r->init ()) {
return -1;
}
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (r.get(), "Route");
#endif
{
BOOST_MARK_ROUTE(r);
{
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
r->input()->ensure_io (count, false, this);
r->output()->ensure_io (count, false, this);
@ -1611,9 +1611,7 @@ Session::XMLRouteFactory (const XMLNode& node, int version)
return ret;
}
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (track.get(), "Track");
#endif
BOOST_MARK_TRACK (track);
ret = track;
} else {
@ -1626,9 +1624,7 @@ Session::XMLRouteFactory (const XMLNode& node, int version)
boost::shared_ptr<Route> r (new Route (*this, X_("toBeResetFroXML"), flags));
if (r->init () == 0 && r->set_state (node, version) == 0) {
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (r.get(), "Route");
#endif
BOOST_MARK_ROUTE (r);
ret = r;
}
}
@ -1689,9 +1685,7 @@ Session::XMLRouteFactory_2X (const XMLNode& node, int version)
track->set_diskstream (*i);
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (track.get(), "Track");
#endif
BOOST_MARK_TRACK (track);
ret = track;
} else {
@ -1704,9 +1698,7 @@ Session::XMLRouteFactory_2X (const XMLNode& node, int version)
boost::shared_ptr<Route> r (new Route (*this, X_("toBeResetFroXML"), flags));
if (r->init () == 0 && r->set_state (node, version) == 0) {
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (r.get(), "Route");
#endif
BOOST_MARK_ROUTE (r);
ret = r;
}
}

View File

@ -22,7 +22,6 @@
#include "libardour-config.h"
#endif
#include "pbd/boost_debug.h"
#include "pbd/error.h"
#include "pbd/convert.h"
#include "pbd/pthread_utils.h"
@ -30,6 +29,7 @@
#include "ardour/audioplaylist.h"
#include "ardour/audio_playlist_source.h"
#include "ardour/boost_debug.h"
#include "ardour/midi_playlist.h"
#include "ardour/midi_playlist_source.h"
#include "ardour/source.h"