/**
* @file
- * @brief Helper function for integerated debug support
+ * @brief Helper function for integrated debug support
* @author Michael Beck
* @date 2005
* @version $Id$
#include "config.h"
#endif
+#include "firm_config.h"
+
#ifdef DEBUG_libfirm
#ifdef _WIN32
#include "entity_t.h"
#include "irprintf.h"
#include "irdump.h"
+#include "iredges_t.h"
#include "debug.h"
#ifdef _WIN32
firm_debug_break();
} /* firm_init_debugger */
+/**
+ * A gdb helper function to print firm objects.
+ */
+const char *gdb_node_helper(void *firm_object) {
+ static char buf[1024];
+ ir_snprintf(buf, sizeof(buf), "%+F", firm_object);
+ return buf;
+}
+
+/**
+ * A gdb helper function to print tarvals.
+ */
+const char *gdb_tarval_helper(void *tv_object) {
+ static char buf[1024];
+ ir_snprintf(buf, sizeof(buf), "%+T", tv_object);
+ return buf;
+}
+
+const char *gdb_out_edge_helper(const ir_node *node) {
+ static char buf[4*1024];
+ char *b = buf;
+ size_t l;
+ size_t len = sizeof(buf);
+ const ir_edge_t *edge;
+ foreach_out_edge(node, edge) {
+ ir_node *n = get_edge_src_irn(edge);
+
+ ir_snprintf(b, len, "%+F ", n);
+ l = strlen(b);
+ len -= l;
+ b += l;
+ }
+
+ return buf;
+}
+
#else
/* some picky compiler do not allow empty files */
-static int _firm_only_that_you_can_compile_with_NDEBUG_defined;
+static int __attribute__((unused)) _firm_only_that_you_can_compile_with_NDEBUG_defined;
#endif /* NDEBUG */