Skip to content

Commit cd4107c

Browse files
authored
Fix #2953 - Handle functions in pxa (not just flags) ##print
1 parent e3895cd commit cd4107c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libr/core/cmd_print.inc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2623,6 +2623,18 @@ static void annotated_hexdump(RCore *core, const char *str, int len) {
26232623
note[j] = r_str_newf (";%s", comment);
26242624
marks = true;
26252625
}
2626+
// collect functions
2627+
RAnalFunction *fcn = r_anal_get_function_at (core->anal, addr + j);
2628+
if (fcn) {
2629+
if (show_section) {
2630+
r_cons_printf (core->cons, "%20s ", "");
2631+
}
2632+
if (usecolor) {
2633+
r_cons_printf (core->cons, "%s/fcn.%s%s\n", Color_YELLOW, fcn->name, Color_RESET);
2634+
} else {
2635+
r_cons_printf (core->cons, "/fcn.%s\n", fcn->name);
2636+
}
2637+
}
26262638
const RList *list = r_flag_get_list (core->flags, addr + j);
26272639
RListIter *iter;
26282640
RFlagItem *fi;

test/db/cmd/cmd_flags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ EOF
709709
EXPECT=<<EOF
710710
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
711711
0x00400c20 feff ff66 2e0f 1f84 0000 0000 000f 1f00 ...f............
712+
/fcn.entry0
712713
/sym._start
713714
0x00400c30 31ed 4989 d15e 4889 e248 83e4 f050 5449 1.I..^H..H...PTI ; arg3
714715
0x00400c40 c7c0 8014 4000 48c7 c1f0 1340 0048 c7c7 ....@.H....@.H..
@@ -724,6 +725,7 @@ fc entry0=red
724725
fc sym._start=red
725726
- offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
726727
0x00400c20 feff ff66 2e0f 1f84 0000 0000 000f 1f00 ...f............
728+
/fcn.entry0
727729
/sym._start
728730
0x00400c30 31ed 4989 d15e 4889 e248 83e4 f050 5449 1.I..^H..H...PTI ; arg3
729731
EOF

0 commit comments

Comments
 (0)