Fix some warnings in debug ()

This commit is contained in:
Fangrui Song 2018-08-05 02:56:15 -07:00 committed by radare
parent 1f87361fe3
commit 6e776b986a
9 changed files with 10 additions and 10 deletions

View File

@ -1445,7 +1445,7 @@ static void get_hash_debug_file(RCore *core, const char *path, char *hash, int h
RBinSection *s;
r_list_foreach (sects, iter, s) {
if (strstr (s->name, ".note.gnu.build-id")) {
if (r_buf_read_at (binfile->buf, s->vaddr + 16, buf, 20) == 20) {
if (r_buf_read_at (binfile->buf, s->vaddr + 16, (ut8*)buf, 20) == 20) {
break;
}
eprintf ("Cannot read from buffer\n");

View File

@ -528,7 +528,7 @@ RDebugPlugin r_debug_plugin_bochs = {
.stop = &r_debug_bochs_stop,
.wait = &r_debug_bochs_wait,
.map_get = r_debug_bochs_map_get,
.breakpoint = (RBreakpointCallback)&r_debug_bochs_breakpoint,
.breakpoint = r_debug_bochs_breakpoint,
.reg_read = &r_debug_bochs_reg_read,
.reg_write = &r_debug_bochs_reg_write,
.reg_profile = (void *)r_debug_bochs_reg_profile,

View File

@ -149,7 +149,7 @@ RDebugPlugin r_debug_plugin_esil = {
.wait = &__esil_wait,
.stop = __esil_stop,
.kill = __esil_kill,
.breakpoint = (RBreakpointCallback)&__esil_breakpoint,
.breakpoint = __esil_breakpoint,
.reg_profile = __esil_reg_profile,
.reg_read = __reg_read,
};

View File

@ -1523,8 +1523,7 @@ static bool arm64_hwbp_del (RDebug *dbg, RBreakpoint *bp, RBreakpointItem *b) {
* we only handle the case for hardware breakpoints here. otherwise,
* we let the caller handle the work.
*/
static int r_debug_native_bp (void *bp_, RBreakpointItem *b, bool set) {
RBreakpoint *bp = (RBreakpoint *)bp_;
static int r_debug_native_bp (RBreakpoint *bp, RBreakpointItem *b, bool set) {
RDebug *dbg = bp->user;
if (b && b->hw) {
#if __i386__ || __x86_64__

View File

@ -342,7 +342,7 @@ RDebugPlugin r_debug_plugin_qnx = {
.canstep = 1,
.wait = &r_debug_qnx_wait,
.map_get = r_debug_qnx_map_get,
.breakpoint = (RBreakpointCallback)&r_debug_qnx_breakpoint,
.breakpoint = r_debug_qnx_breakpoint,
.reg_read = &r_debug_qnx_reg_read,
.reg_write = &r_debug_qnx_reg_write,
.reg_profile = (void *)r_debug_qnx_reg_profile,

View File

@ -74,7 +74,7 @@ RDebugPlugin r_debug_plugin_rap = {
.attach = &r_debug_rap_attach,
.detach = &r_debug_rap_detach,
.wait = &r_debug_rap_wait,
.breakpoint = (RBreakpointCallback)&r_debug_rap_breakpoint,
.breakpoint = r_debug_rap_breakpoint,
.reg_read = &r_debug_rap_reg_read,
.reg_write = &r_debug_rap_reg_write,
.reg_profile = (void *)r_debug_rap_reg_profile,

View File

@ -243,7 +243,7 @@ RDebugPlugin r_debug_plugin_windbg = {
.pids = &r_debug_windbg_pids,
.wait = &r_debug_windbg_wait,
.select = &r_debug_windbg_select,
.breakpoint = (RBreakpointCallback)&r_debug_windbg_breakpoint,
.breakpoint = r_debug_windbg_breakpoint,
.reg_read = &r_debug_windbg_reg_read,
.reg_write = &r_debug_windbg_reg_write,
.reg_profile = &r_debug_windbg_reg_profile,

View File

@ -75,7 +75,7 @@ int linux_handle_signals (RDebug *dbg) {
//ptrace (PTRACE_SETSIGINFO, dbg->pid, 0, &siginfo);
dbg->reason.type = R_DEBUG_REASON_SIGNAL;
dbg->reason.signum = siginfo.si_signo;
dbg->stopaddr = siginfo.si_addr;
dbg->stopaddr = (ut64)siginfo.si_addr;
//dbg->errno = siginfo.si_errno;
// siginfo.si_code -> HWBKPT, USER, KERNEL or WHAT
#warning DO MORE RDEBUGREASON HERE

View File

@ -62,7 +62,8 @@ typedef struct r_bp_item_t {
char *expr; /* to be used for named breakpoints (see r_debug_bp_update) */
} RBreakpointItem;
typedef int (*RBreakpointCallback)(void *bp, RBreakpointItem *b, bool set);
struct r_bp_t;
typedef int (*RBreakpointCallback)(struct r_bp_t *bp, RBreakpointItem *b, bool set);
typedef struct r_bp_t {
void *user;