Skip to content

Commit

Permalink
aap /rc and others use R_LOG_DEBUG now to be less noisy for batch runs
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed Nov 15, 2023
1 parent a62d03c commit 8a73d19
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions libr/core/canal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4160,6 +4160,11 @@ static bool opiscall(RCore *core, RAnalOp *aop, ut64 addr, const ut8* buf, int l
// TODO(maskray) RAddrInterval API
#define OPSZ 8
R_API int r_core_anal_search(RCore *core, ut64 from, ut64 to, ut64 ref, int mode) {
r_return_val_if_fail (core, -1);
if (!ref) {
R_LOG_ERROR ("Null reference search is not supported");
return -1;
}
ut8 *buf = (ut8 *)malloc (core->blocksize);
if (!buf) {
return -1;
Expand All @@ -4182,11 +4187,6 @@ R_API int r_core_anal_search(RCore *core, ut64 from, ut64 to, ut64 ref, int mode
// ???
// XXX must read bytes correctly
do_bckwrd_srch = bckwrds = core->search->bckwrds;
if (!ref) {
R_LOG_ERROR ("Null reference search is not supported");
free (buf);
return -1;
}
r_cons_break_push (NULL, NULL);
if (core->blocksize > OPSZ) {
if (bckwrds) {
Expand All @@ -4200,7 +4200,7 @@ R_API int r_core_anal_search(RCore *core, ut64 from, ut64 to, ut64 ref, int mode
at = from;
}
while ((!bckwrds && at < to) || bckwrds) {
eprintf ("\r[0x%08"PFMT64x"-0x%08"PFMT64x"] ", at, to);
R_LOG_DEBUG ("[0x%08"PFMT64x"-0x%08"PFMT64x"]", at, to);
if (r_cons_is_breaked ()) {
break;
}
Expand Down
11 changes: 5 additions & 6 deletions libr/core/cmd_search.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4091,7 +4091,7 @@ static int cmd_search(void *data, const char *input) {
RListIter *iter;
RIOMap *map;
r_list_foreach (param.boundaries, iter, map) {
eprintf ("-- 0x%"PFMT64x" 0x%"PFMT64x"\n", r_io_map_begin (map), r_io_map_end (map));
R_LOG_DEBUG ("-- 0x%"PFMT64x" 0x%"PFMT64x, r_io_map_begin (map), r_io_map_end (map));
r_core_anal_search (core, r_io_map_begin (map), r_io_map_end (map), n, 0);
}
}
Expand All @@ -4101,7 +4101,7 @@ static int cmd_search(void *data, const char *input) {
RListIter *iter;
RIOMap *map;
r_list_foreach (param.boundaries, iter, map) {
eprintf ("-- 0x%"PFMT64x" 0x%"PFMT64x"\n", r_io_map_begin (map), r_io_map_end (map));
R_LOG_DEBUG ("-- 0x%"PFMT64x" 0x%"PFMT64x, r_io_map_begin (map), r_io_map_end (map));
r_core_anal_search (core, r_io_map_begin (map), r_io_map_end (map), n, 'c');
}
}
Expand All @@ -4111,7 +4111,7 @@ static int cmd_search(void *data, const char *input) {
RListIter *iter;
RIOMap *map;
r_list_foreach (param.boundaries, iter, map) {
eprintf ("-- 0x%"PFMT64x" 0x%"PFMT64x"\n", r_io_map_begin (map), r_io_map_end (map));
R_LOG_DEBUG ("-- 0x%"PFMT64x" 0x%"PFMT64x, r_io_map_begin (map), r_io_map_end (map));
ut64 refptr = r_num_math (core->num, input + 2);
ut64 curseek = core->offset;
r_core_seek (core, r_io_map_begin (map), true);
Expand Down Expand Up @@ -4145,7 +4145,7 @@ static int cmd_search(void *data, const char *input) {
RListIter *iter;
RIOMap *map;
r_list_foreach (param.boundaries, iter, map) {
eprintf ("-- 0x%"PFMT64x" 0x%"PFMT64x"\n", r_io_map_begin (map), r_io_map_end (map));
R_LOG_DEBUG ("-- 0x%"PFMT64x" 0x%"PFMT64x, r_io_map_begin (map), r_io_map_end (map));
r_core_anal_search (core, r_io_map_begin (map), r_io_map_end (map), n, input[1]);
}
}
Expand All @@ -4159,8 +4159,7 @@ static int cmd_search(void *data, const char *input) {
ut64 from = r_io_map_begin (map);
ut64 to = r_io_map_end (map);
if (input[param_offset - 1] == ' ') {
r_core_anal_search (core, from, to,
r_num_math (core->num, input + 2), 0);
r_core_anal_search (core, from, to, r_num_math (core->num, input + 2), 0);
do_ref_search (core, r_num_math (core->num, input + 2), from, to, &param);
} else {
r_core_anal_search (core, from, to, core->offset, 0);
Expand Down

0 comments on commit 8a73d19

Please sign in to comment.