mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-02 19:55:14 +00:00
b20295c4ea
- Some minor hacks everywhere to glue - 'dr' command runs '|reg' io-ptrace command (reg dbg stuff needs more work) - '|reg' is a temporal command that prints x86-ptrace-linux registers * Added debug visual print mode using && :) - 's' key steps in debugger * Added m and ' keys in visual (mark and goto mark) like in vim or r1 :) - store/use seek addresses * Make use of the cmd.prompt and cmd.vprompt magic * Added debug handlers list with 'dh' - dh ptrace called at init - dp pid called at init too (hacky style) * Added debug->wait method for the debug handlers * Add 'fb' command to set base for flags * Fix flag redefinition (f foo && f foo @ 33) now works * Added s64 type (signed 64 bit integer) * Fixed && and '"' special chars in commnad parsing --HG-- rename : libr/debug/p/ptrace.c => libr/debug/p/dbg-ptrace.c
44 lines
990 B
C
44 lines
990 B
C
/* radare - LGPL - Copyright 2009 pancake<nopcode.org> */
|
|
|
|
#include <r_debug.h>
|
|
|
|
/* XXX move to debug_init() ?? */
|
|
int r_debug_handle_init(struct r_debug_t *dbg)
|
|
{
|
|
INIT_LIST_HEAD(&dbg->handlers);
|
|
return R_TRUE;
|
|
}
|
|
|
|
int r_debug_handle_set(struct r_debug_t *dbg, const char *str)
|
|
{
|
|
struct list_head *pos;
|
|
list_for_each_prev(pos, &dbg->handlers) {
|
|
struct r_debug_handle_t *h = list_entry(pos, struct r_debug_handle_t, list);
|
|
if (!strcmp(str, h->name)) {
|
|
dbg->h = h;
|
|
return R_TRUE;
|
|
}
|
|
}
|
|
|
|
return R_FALSE;
|
|
}
|
|
|
|
int r_debug_handle_list(struct r_debug_t *dbg, const char *str)
|
|
{
|
|
int count = 0;
|
|
struct list_head *pos;
|
|
list_for_each_prev(pos, &dbg->handlers) {
|
|
struct r_debug_handle_t *h = list_entry(pos, struct r_debug_handle_t, list);
|
|
printf("%d %s %s\n", count, h->name, ((h==dbg->h)?"*":""));
|
|
count++;
|
|
}
|
|
|
|
return R_FALSE;
|
|
}
|
|
|
|
int r_debug_handle_add(struct r_debug_t *dbg, struct r_debug_handle_t *foo)
|
|
{
|
|
list_add_tail(&(foo->list), &(dbg->handlers));
|
|
return R_TRUE;
|
|
}
|