2010-06-29 23:13:09 +00:00
|
|
|
/* radare - LGPL - Copyright 2009-2010 pancake<nopcode.org> */
|
2009-09-13 22:37:28 +00:00
|
|
|
|
|
|
|
#include <r_bp.h>
|
|
|
|
|
2010-06-29 23:13:09 +00:00
|
|
|
R_API int r_bp_plugin_del(struct r_bp_t *bp, const char *name) {
|
2010-05-26 16:25:35 +00:00
|
|
|
#warning TODO: r_bp_plugin_del
|
2009-09-13 22:37:28 +00:00
|
|
|
return R_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-06-29 23:13:09 +00:00
|
|
|
R_API int r_bp_plugin_add(RBreakpoint *bp, RBreakpointPlugin *foo) {
|
|
|
|
RListIter *iter;
|
|
|
|
RBreakpointPlugin *h;
|
2009-09-13 22:37:28 +00:00
|
|
|
if (bp == NULL) {
|
2010-06-29 23:13:09 +00:00
|
|
|
eprintf ("Cannot add plugin because dbg->bp is null and/or plugin is null\n");
|
2009-09-13 22:37:28 +00:00
|
|
|
return R_FALSE;
|
|
|
|
}
|
|
|
|
/* avoid dupped plugins */
|
2010-06-29 23:13:09 +00:00
|
|
|
r_list_foreach (bp->bps, iter, h) {
|
2010-03-02 23:13:22 +00:00
|
|
|
if (!strcmp (h->name, foo->name))
|
2009-09-13 22:37:28 +00:00
|
|
|
return R_FALSE;
|
|
|
|
}
|
|
|
|
bp->nbps++;
|
2010-06-29 23:13:09 +00:00
|
|
|
r_list_append (bp->plugins, foo);
|
2009-09-13 22:37:28 +00:00
|
|
|
return R_TRUE;
|
|
|
|
}
|
|
|
|
|
2010-06-29 23:13:09 +00:00
|
|
|
R_API int r_bp_use(struct r_bp_t *bp, const char *name) {
|
|
|
|
RListIter *iter;
|
|
|
|
RBreakpointPlugin *h;
|
|
|
|
r_list_foreach (bp->plugins, iter, h) {
|
2010-03-02 23:13:22 +00:00
|
|
|
if (!strcmp (h->name, name)) {
|
2009-09-13 22:37:28 +00:00
|
|
|
bp->cur = h;
|
|
|
|
return R_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return R_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: deprecate
|
2010-06-29 23:13:09 +00:00
|
|
|
R_API void r_bp_plugin_list(RBreakpoint *bp) {
|
|
|
|
RListIter *iter;
|
|
|
|
RBreakpointPlugin *b;
|
|
|
|
r_list_foreach (bp->plugins, iter, b) {
|
|
|
|
bp->printf ("bp %c %s\n",
|
2010-03-02 23:13:22 +00:00
|
|
|
(bp->cur && !strcmp (bp->cur->name, b->name))?'*':'-',
|
2009-09-13 22:37:28 +00:00
|
|
|
b->name);
|
|
|
|
}
|
|
|
|
}
|