summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/property_tree.ipp4
-rw-r--r--host/include/uhd/utils/msg.hpp3
2 files changed, 7 insertions, 0 deletions
diff --git a/host/include/uhd/property_tree.ipp b/host/include/uhd/property_tree.ipp
index 5fbb2dda5..58ee2339c 100644
--- a/host/include/uhd/property_tree.ipp
+++ b/host/include/uhd/property_tree.ipp
@@ -18,6 +18,7 @@
#ifndef INCLUDED_UHD_PROPERTY_TREE_IPP
#define INCLUDED_UHD_PROPERTY_TREE_IPP
+#include <uhd/exception.hpp>
#include <boost/foreach.hpp>
#include <vector>
@@ -58,6 +59,9 @@ public:
}
T get(void) const{
+ if (_publisher.empty() and _value.get() == NULL) throw uhd::runtime_error(
+ "Called get() on property with an uninitialized value"
+ );
return _publisher.empty()? *_value : _publisher();
}
diff --git a/host/include/uhd/utils/msg.hpp b/host/include/uhd/utils/msg.hpp
index 71d2cb35e..b0f00e13d 100644
--- a/host/include/uhd/utils/msg.hpp
+++ b/host/include/uhd/utils/msg.hpp
@@ -30,6 +30,9 @@
#define UHD_MSG(type) \
uhd::msg::_msg(uhd::msg::type)()
+//! Helpful debug tool to print site info
+#define UHD_HERE() \
+ UHD_MSG(status) << __FILE__ << ":" << __LINE__ << std::endl
namespace uhd{ namespace msg{