#include <windows.h>
#endif
+#include "debugger.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
do { \
debugger_hooks[h].hook._##h = fkt; \
register_hook(h, &debugger_hooks[h]); \
-} while(0)
+} while (0)
/** unhook the hook h */
#define UNHOOK(h) \
do { \
unregister_hook(h, &debugger_hooks[h]); \
debugger_hooks[h].hook._##h = NULL; \
-} while(0)
+} while (0)
/** returns non-zero if a entry hook h is used */
#define IS_HOOKED(h) (debugger_hooks[h].hook._##h != NULL)
#define FIRM_DBG_MINOR 0
/** for automatic detection of the debug extension */
-static const char firm_debug_info_string[] =
+static const char __attribute__((used)) firm_debug_info_string[] =
API_VERSION(FIRM_DBG_MAJOR, FIRM_DBG_MINOR);
-/**
- * Returns non-zero, if the debug extension is active
- */
int firm_debug_active(void)
{
return is_active;
firm_dbg_msg_buf[0] = '\0';
} /* reset_dbg_buf */
-/**
- * Add text to the debug text buffer.
- */
static void add_to_dbg_buf(const char *buf)
{
strncat(firm_dbg_msg_buf, buf, sizeof(firm_dbg_msg_buf));
} /* add_to_dbg_buf */
-/**
- * Return the content of the debug text buffer.
- *
- * To be called from the debugger.
- */
const char *firm_debug_text(void)
{
firm_dbg_msg_buf[sizeof(firm_dbg_msg_buf) - 1] = '\0';
CASE_ON(BP_ON_NEW_ENT, new_entity);
CASE_ON(BP_ON_NEW_TYPE, new_type);
default:
- ;
+ break;
}
}
else {
CASE_OFF(BP_ON_NEW_ENT, new_entity);
CASE_OFF(BP_ON_NEW_TYPE, new_type);
default:
- ;
+ break;
}
}
#undef CASE_ON
return c;
} /* get_token */
-/**
- * High level function to use from debugger interface
- *
- * See show_commands() for supported commands.
- */
void firm_debug(const char *cmd)
{
char name[1024], fname[1024];
;
} /* firm_debug */
-/* creates the debugger tables */
void firm_init_debugger(void)
{
char *env;
return buf;
}
-/**
- * A gdb helper function to print tarvals.
- */
const char *gdb_tarval_helper(void *tv_object)
{
static char buf[1024];