Skip to content

Commit fa1af3d

Browse files
committed
dbg->cb_printf -> rz_cons_printf
1 parent 4028257 commit fa1af3d

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

librz/core/cdebug.c

+10-17
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ RZ_IPI bool rz_core_debug_reg_list(RzCore *core, int type, int size, PJ *pj, int
297297
return false;
298298
}
299299
if (rad == 1 || rad == '*') {
300-
dbg->cb_printf("fs+%s\n", RZ_FLAGS_FS_REGISTERS);
300+
rz_cons_printf("fs+%s\n", RZ_FLAGS_FS_REGISTERS);
301301
}
302302
rz_list_foreach (head, iter, item) {
303303
ut64 value;
@@ -442,7 +442,7 @@ RZ_IPI bool rz_core_debug_reg_list(RzCore *core, int type, int size, PJ *pj, int
442442
n++;
443443
}
444444
if (rad == 1 || rad == '*') {
445-
dbg->cb_printf("fs-\n");
445+
rz_cons_printf("fs-\n");
446446
}
447447
beach:
448448
if (isJson) {
@@ -656,11 +656,6 @@ static void print_debug_map_json(RzDebugMap *map, PJ *pj) {
656656
pj_end(pj);
657657
}
658658

659-
/* Write the memory map header describing the line columns */
660-
static void print_debug_map_line_header(RzDebug *dbg) {
661-
// TODO: Write header to console based on which command is being ran
662-
}
663-
664659
/* Write a single memory map line to the console */
665660
static void print_debug_map_line(RzDebug *dbg, RzDebugMap *map, ut64 addr, RzOutputMode mode) {
666661
char humansz[8];
@@ -670,7 +665,7 @@ static void print_debug_map_line(RzDebug *dbg, RzDebugMap *map, ut64 addr, RzOut
670665
: rz_str_newf("%08" PFMT64x ".%s", map->addr, rz_str_rwx_i(map->perm));
671666
rz_name_filter(name, 0, true);
672667
rz_num_units(humansz, sizeof(humansz), map->addr_end - map->addr);
673-
dbg->cb_printf("0x%016" PFMT64x " - 0x%016" PFMT64x " %6s %5s %s\n",
668+
rz_cons_printf("0x%016" PFMT64x " - 0x%016" PFMT64x " %6s %5s %s\n",
674669
map->addr,
675670
map->addr_end,
676671
humansz,
@@ -697,7 +692,7 @@ static void print_debug_map_line(RzDebug *dbg, RzDebugMap *map, ut64 addr, RzOut
697692
free(filtered_name);
698693
}
699694
rz_num_units(humansz, sizeof(humansz), map->size);
700-
dbg->cb_printf(fmtstr,
695+
rz_cons_printf(fmtstr,
701696
map->addr,
702697
map->addr_end,
703698
(addr >= map->addr && addr < map->addr_end) ? '*' : '-',
@@ -727,8 +722,6 @@ RZ_API void rz_debug_map_print(RzDebug *dbg, ut64 addr, RzOutputMode mode) {
727722
return;
728723
}
729724
pj_a(pj);
730-
} else if (mode == RZ_OUTPUT_MODE_STANDARD) {
731-
print_debug_map_line_header(dbg);
732725
}
733726

734727
for (i = 0; i < 2; i++) { // Iterate over dbg::maps and dbg::maps_user
@@ -744,7 +737,7 @@ RZ_API void rz_debug_map_print(RzDebug *dbg, ut64 addr, RzOutputMode mode) {
744737
? rz_str_newf("%s.%s", map->name, rz_str_rwx_i(map->perm))
745738
: rz_str_newf("%08" PFMT64x ".%s", map->addr, rz_str_rwx_i(map->perm));
746739
rz_name_filter(name, 0, true);
747-
dbg->cb_printf("f map.%s 0x%08" PFMT64x " 0x%08" PFMT64x "\n",
740+
rz_cons_printf("f map.%s 0x%08" PFMT64x " 0x%08" PFMT64x "\n",
748741
name, map->addr_end - map->addr + 1, map->addr);
749742
free(name);
750743
} break;
@@ -765,7 +758,7 @@ RZ_API void rz_debug_map_print(RzDebug *dbg, ut64 addr, RzOutputMode mode) {
765758

766759
if (pj) { // "dmj" add JSON closing array brace
767760
pj_end(pj);
768-
dbg->cb_printf("%s\n", pj_string(pj));
761+
rz_cons_printf("%s\n", pj_string(pj));
769762
pj_free(pj);
770763
}
771764
}
@@ -852,7 +845,7 @@ static void print_debug_maps_ascii_art(RzDebug *dbg, RzList *maps, ut64 addr, in
852845
fmtstr = dbg->bits & RZ_SYS_BITS_64 // Prefix formatting string (before bar)
853846
? "map %4.8s %c %s0x%016" PFMT64x "%s |"
854847
: "map %4.8s %c %s0x%08" PFMT64x "%s |";
855-
dbg->cb_printf(fmtstr, humansz,
848+
rz_cons_printf(fmtstr, humansz,
856849
(addr >= map->addr &&
857850
addr < map->addr_end)
858851
? '*'
@@ -863,15 +856,15 @@ static void print_debug_maps_ascii_art(RzDebug *dbg, RzList *maps, ut64 addr, in
863856
ut64 pos = min + (col * mul); // Current address space to check
864857
ut64 npos = min + ((col + 1) * mul); // Next address space to check
865858
if (map->addr < npos && map->addr_end > pos) {
866-
dbg->cb_printf("#"); // TODO: Comment what a # represents
859+
rz_cons_printf("#"); // TODO: Comment what a # represents
867860
} else {
868-
dbg->cb_printf("-");
861+
rz_cons_printf("-");
869862
}
870863
}
871864
fmtstr = dbg->bits & RZ_SYS_BITS_64 ? // Suffix formatting string (after bar)
872865
"| %s0x%016" PFMT64x "%s %s %s\n"
873866
: "| %s0x%08" PFMT64x "%s %s %s\n";
874-
dbg->cb_printf(fmtstr, color_prefix, map->addr_end, color_suffix,
867+
rz_cons_printf(fmtstr, color_prefix, map->addr_end, color_suffix,
875868
rz_str_rwx_i(map->perm), map->name);
876869
last = map->addr;
877870
}

0 commit comments

Comments
 (0)