/**
* @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
static void dbg_new_node(void *ctx, ir_graph *irg, ir_node *node)
{
bp_nr_t key, *elem;
+ (void) ctx;
+ (void) irg;
key.nr = get_irn_node_nr(node);
key.bp.reason = BP_ON_NEW_NODE;
static void dbg_replace(void *ctx, ir_node *old, ir_node *nw)
{
bp_nr_t key, *elem;
+ (void) ctx;
key.nr = get_irn_node_nr(old);
key.bp.reason = BP_ON_REPLACE;
static void dbg_lower(void *ctx, ir_node *node)
{
bp_nr_t key, *elem;
+ (void) ctx;
key.nr = get_irn_node_nr(node);
key.bp.reason = BP_ON_LOWER;
*/
static void dbg_free_graph(void *ctx, ir_graph *irg)
{
+ (void) ctx;
{
bp_nr_t key, *elem;
key.nr = get_irg_graph_nr(irg);
*/
static void dbg_new_entity(void *ctx, ir_entity *ent)
{
+ (void) ctx;
{
bp_ident_t key, *elem;
*/
static void dbg_new_type(void *ctx, ir_type *tp)
{
+ (void) ctx;
{
bp_nr_t key, *elem;
{
const bp_nr_t *e1 = elt;
const bp_nr_t *e2 = key;
+ (void) size;
return (e1->nr - e2->nr) | (e1->bp.reason - e2->bp.reason);
} /* cmp_nr_bp */
{
const bp_ident_t *e1 = elt;
const bp_ident_t *e2 = key;
+ (void) size;
return (e1->id != e2->id) | (e1->bp.reason - e2->bp.reason);
} /* cmp_ident_bp */
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;
+}
+
#else
/* some picky compiler do not allow empty files */