Skip to content

Commit

Permalink
Fix #21333 - Update radiff2 manpage, add mermaid mode ##tools
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Feb 10, 2023
1 parent 960acc5 commit 695e392
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
7 changes: 6 additions & 1 deletion libr/main/radiff2.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2022 - pancake */
/* radare - LGPL - Copyright 2009-2023 - pancake */

#define R_LOG_ORIGIN "radiff2"

Expand Down Expand Up @@ -29,6 +29,7 @@ enum {
GRAPH_TINY_MODE,
GRAPH_INTERACTIVE_MODE,
GRAPH_DOT_MODE,
GRAPH_MERMAID_MODE,
GRAPH_STAR_MODE,
GRAPH_GML_MODE
};
Expand Down Expand Up @@ -978,6 +979,9 @@ static void __print_diff_graph(RCore *c, ut64 off, int gmode) {
case GRAPH_DOT_MODE:
r_core_anal_graph (c, off, opts);
break;
case GRAPH_MERMAID_MODE:
r_core_agraph_print (c, use_utf8, "m");
break;
case GRAPH_STAR_MODE:
r_core_anal_graph (c, off, opts | R_CORE_ANAL_STAR);
break;
Expand Down Expand Up @@ -1095,6 +1099,7 @@ R_API int r_main_radiff2(int argc, const char **argv) {
case 't': ro.gmode = GRAPH_TINY_MODE; break;
case 'd': ro.gmode = GRAPH_DOT_MODE; break;
case 's': ro.gmode = GRAPH_STAR_MODE; break;
case 'm': ro.gmode = GRAPH_MERMAID_MODE; break;
case 'g': ro.gmode = GRAPH_GML_MODE; break;
case 'a':
default: ro.gmode = GRAPH_DEFAULT_MODE; break;
Expand Down
14 changes: 11 additions & 3 deletions man/radiff2.1
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
.Sh SYNOPSIS
.Nm radiff2
.Op Fl 1AabcCdDhOrspxXvzZ
.Op Fl t Ar 0-100
.Op Fl B Ar baddr
.Op Fl i Ar i,s
.Op Fl g Ar sym
.Op Fl G Ar cmd
.Op Fl S Ar algo
.Op Fl g Ar sym
.Op Fl i Ar i,s
.Op Fl m Ar graphmode
.Op Fl t Ar 0-100
.Ar file1
.Ar file2
.Sh DESCRIPTION
Expand Down Expand Up @@ -39,14 +41,20 @@ Use delta diffing (slower).
Show disasm instead of hexpairs (honors -a arch and -b bits)
.It Fl g Ar sym | off1,off2
Graph diff output of given symbol, or between two functions, at given offsets: one for each binary.
.It Fl G Ar [cmd]
Run given command after creating each core instance
.It Fl h
Show usage help message.
.It Fl i Ar i, s, c, m, f
Compare (i)mports, (s)ymbols, (c)lassnames, (m)ethods, (f)ields from given files (radiff2 -ii /bin/ls /bin/cat)
.It Fl j
Use JSON for output
.It Fl n
Suppress address names (show only addresses) when code diffing.
.It Fl O
Do code diffing with opcode bytes only.
.It Fl m Ar [graphmode]
Specify the graph mode (i)nteractive, (k)ey-value, (j)son, (J)son2, (t)iny, (d)ot, (s)tar, (g)ml, (m)ermaid
.It Fl p
Use physical addressing (io.va=0)
.It Fl q
Expand Down

0 comments on commit 695e392

Please sign in to comment.