mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-26 22:50:48 +00:00
Debug plugin fallbacks ##debug
This commit is contained in:
parent
aa0b3e86df
commit
2e64ce0112
@ -1849,11 +1849,21 @@ static bool cb_dbgbackend(void *user, void *data) {
|
||||
r_debug_plugin_list (core->dbg, 'q');
|
||||
return false;
|
||||
}
|
||||
// TODO: probably not necessary
|
||||
if (!strcmp (node->value, "bf")) {
|
||||
// hack
|
||||
r_config_set (core->config, "asm.arch", "bf");
|
||||
}
|
||||
r_debug_use (core->dbg, node->value);
|
||||
if (r_debug_use (core->dbg, node->value)) {
|
||||
RDebugPlugin *plugin = R_UNWRAP3 (core->dbg, current, plugin);
|
||||
if (plugin) {
|
||||
const char *name = plugin->meta.name;
|
||||
r_core_cmd0 (core, "aei");
|
||||
free (node->value);
|
||||
node->value = strdup (name);
|
||||
}
|
||||
} else {
|
||||
R_LOG_ERROR ("Cannot find a valid debug plugin");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,9 +36,14 @@ static inline int find_plugin_by_name(const RDebugPluginSession *ds, const void
|
||||
|
||||
R_API bool r_debug_use(RDebug *dbg, const char *str) {
|
||||
r_return_val_if_fail (dbg, false);
|
||||
RDebugPluginSession *ds = NULL;
|
||||
if (R_STR_ISNOTEMPTY (str)) {
|
||||
ds = RVecDebugPluginSession_find (dbg->plugins, (void*)str, find_plugin_by_name);
|
||||
RDebugPluginSession *ds = RVecDebugPluginSession_find (dbg->plugins, (void*)str, find_plugin_by_name);
|
||||
if (!ds) {
|
||||
ds = RVecDebugPluginSession_find (dbg->plugins, (void*)"esil", find_plugin_by_name);
|
||||
if (!ds) {
|
||||
ds = RVecDebugPluginSession_find (dbg->plugins, (void*)"null", find_plugin_by_name);
|
||||
}
|
||||
}
|
||||
if (ds) {
|
||||
dbg->current = ds;
|
||||
if (dbg->anal && dbg->anal->cur) {
|
||||
|
Loading…
Reference in New Issue
Block a user