Fix warnings in debug (#10981)

This commit is contained in:
Fangrui Song 2018-08-07 21:14:47 -07:00 committed by Anton Kochkov
parent 3565137460
commit a93d33d23f
3 changed files with 6 additions and 5 deletions

View File

@ -1421,7 +1421,7 @@ static int cmd_dbg_map_heap_glibc_64 (RCore *core, const char *input);
static void get_hash_debug_file(RCore *core, const char *path, char *hash, int hash_len) {
RListIter *iter;
char buf[20] = R_EMPTY;
ut8 buf[20] = {0};
int offset, i, j = 0;
int bd = -1;
RBinFile *old_cur = r_bin_cur (core->bin);
@ -1462,7 +1462,7 @@ static void get_hash_debug_file(RCore *core, const char *path, char *hash, int h
hash[i + 2 * j++] = (ut8) '/';
}
offset = j + 2 * i;
snprintf (hash + offset, hash_len - offset, "%02x", (ut8) buf[i]);
snprintf (hash + offset, hash_len - offset, "%02x", buf[i]);
}
offset = j + 2 * i;
snprintf (hash + offset, hash_len - offset - strlen (".debug"), ".debug");

View File

@ -972,7 +972,7 @@ static const char *r_debug_gdb_reg_profile(RDebug *dbg) {
}
static int r_debug_gdb_breakpoint (RBreakpoint *bp, RBreakpointItem *b, bool set) {
int ret, bpsize;
int ret = 0, bpsize;
if (!b) {
return false;
}
@ -1009,7 +1009,7 @@ static int r_debug_gdb_breakpoint (RBreakpoint *bp, RBreakpointItem *b, bool set
if (set)
gdbr_set_hwa (desc, b->addr, "", 1);
else
gdbr_remove_hwa (desc, b->addr, 1);
gdbr_remove_hwa (desc, b->addr, 1);
break;
}
}

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;