-uint64_t PBD::DEBUG::Stateful = PBD::new_debug_bit ("stateful");
-uint64_t PBD::DEBUG::Properties = PBD::new_debug_bit ("properties");
-uint64_t PBD::DEBUG::FileManager = PBD::new_debug_bit ("filemanager");
-uint64_t PBD::DEBUG::Pool = PBD::new_debug_bit ("pool");
+typedef std::map<const char*,DebugBits> DebugMap;
+
+namespace PBD {
+ DebugMap & _debug_bit_map()
+ {
+ static DebugMap map;
+ return map;
+ }
+}
+
+DebugBits PBD::DEBUG::Stateful = PBD::new_debug_bit ("stateful");
+DebugBits PBD::DEBUG::Properties = PBD::new_debug_bit ("properties");
+DebugBits PBD::DEBUG::FileManager = PBD::new_debug_bit ("filemanager");
+DebugBits PBD::DEBUG::Pool = PBD::new_debug_bit ("pool");
+DebugBits PBD::DEBUG::EventLoop = PBD::new_debug_bit ("eventloop");
+DebugBits PBD::DEBUG::AbstractUI = PBD::new_debug_bit ("abstractui");
+DebugBits PBD::DEBUG::FileUtils = PBD::new_debug_bit ("fileutils");
+DebugBits PBD::DEBUG::Configuration = PBD::new_debug_bit ("configuration");
+DebugBits PBD::DEBUG::UndoHistory = PBD::new_debug_bit ("undohistory");
+DebugBits PBD::DEBUG::Timing = PBD::new_debug_bit ("timing");
+DebugBits PBD::DEBUG::Threads = PBD::new_debug_bit ("threads");
+DebugBits PBD::DEBUG::Locale = PBD::new_debug_bit ("locale");
+
+/* These are debug bits that are used by backends. Since these are loaded dynamically,
+ after command-line parsing, defining them in code that is part of the backend
+ doesn't make them available for command line parsing. Put them here.
+
+ This is sort of a hack, because it means that the debug bits aren't defined
+ with the code in which they are relevant. But providing access to debug bits
+ from dynamically loaded code, for use in command line parsing, is way above the pay grade
+ of this debug tracing scheme.
+*/
+DebugBits PBD::DEBUG::WavesMIDI = PBD::new_debug_bit ("WavesMIDI");
+DebugBits PBD::DEBUG::WavesAudio = PBD::new_debug_bit ("WavesAudio");