Skip to content

Commit a7d643a

Browse files
XVilkawargio
andauthored
Added agw details and fixed memleak (#3378) (#3379)
Co-authored-by: Giovanni <[email protected]>
1 parent e8501a1 commit a7d643a

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

librz/core/cgraph.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,5 +725,6 @@ RZ_API bool rz_core_graph_write(RZ_NONNULL RzCore *core, ut64 addr, RzCoreGraphT
725725
return false;
726726
}
727727
rz_core_graph_write_graph(core, graph, path);
728+
rz_graph_free(graph);
728729
return true;
729730
}

librz/core/cmd_descs/cmd_analysis.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,27 @@ commands:
11711171
type: RZ_CMD_ARG_TYPE_OPTION
11721172
flags: RZ_CMD_ARG_FLAG_OPTION
11731173
optional: true
1174+
details:
1175+
- name: "Graph Type"
1176+
entries:
1177+
- text: "dataref"
1178+
comment: "Data reference graph"
1179+
- text: "funcall"
1180+
comment: "Function call graph"
1181+
- text: "diff"
1182+
comment: "Diff graph"
1183+
- text: "funblock"
1184+
comment: "Function basic block graph"
1185+
- text: "import"
1186+
comment: "Imports graph"
1187+
- text: "ref"
1188+
comment: "References graph"
1189+
- text: "line"
1190+
comment: "Line graph"
1191+
- text: "xref"
1192+
comment: "Cross references graph"
1193+
- text: "custom"
1194+
comment: "Custom made graph"
11741195
#####################################################
11751196
# Keep this in sync with dr in cmd_debug.yaml from here...
11761197
- name: ar

librz/core/cmd_descs/cmd_descs.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ static const RzCmdDescDetail analysis_all_esil_details[2];
1717
static const RzCmdDescDetail analyze_all_preludes_details[2];
1818
static const RzCmdDescDetail analysis_functions_merge_details[2];
1919
static const RzCmdDescDetail analysis_appcall_details[2];
20+
static const RzCmdDescDetail analysis_graph_write_details[2];
2021
static const RzCmdDescDetail ag_details[2];
2122
static const RzCmdDescDetail analysis_reg_cond_details[4];
2223
static const RzCmdDescDetail ar_details[2];
@@ -3431,6 +3432,22 @@ static const RzCmdDescHelp analysis_graph_custom_edge_remove_help = {
34313432
.args = analysis_graph_custom_edge_remove_args,
34323433
};
34333434

3435+
static const RzCmdDescDetailEntry analysis_graph_write_Graph_space_Type_detail_entries[] = {
3436+
{ .text = "dataref", .arg_str = NULL, .comment = "Data reference graph" },
3437+
{ .text = "funcall", .arg_str = NULL, .comment = "Function call graph" },
3438+
{ .text = "diff", .arg_str = NULL, .comment = "Diff graph" },
3439+
{ .text = "funblock", .arg_str = NULL, .comment = "Function basic block graph" },
3440+
{ .text = "import", .arg_str = NULL, .comment = "Imports graph" },
3441+
{ .text = "ref", .arg_str = NULL, .comment = "References graph" },
3442+
{ .text = "line", .arg_str = NULL, .comment = "Line graph" },
3443+
{ .text = "xref", .arg_str = NULL, .comment = "Cross references graph" },
3444+
{ .text = "custom", .arg_str = NULL, .comment = "Custom made graph" },
3445+
{ 0 },
3446+
};
3447+
static const RzCmdDescDetail analysis_graph_write_details[] = {
3448+
{ .name = "Graph Type", .entries = analysis_graph_write_Graph_space_Type_detail_entries },
3449+
{ 0 },
3450+
};
34343451
static const char *analysis_graph_write_graphtype_choices[] = { "dataref", "funcall", "diff", "funblock", "import", "ref", "line", "xref", "custom", NULL };
34353452
static const RzCmdDescArg analysis_graph_write_args[] = {
34363453
{
@@ -3456,6 +3473,7 @@ static const RzCmdDescArg analysis_graph_write_args[] = {
34563473
};
34573474
static const RzCmdDescHelp analysis_graph_write_help = {
34583475
.summary = "Write to path or display graph image (see graph.gv.format)",
3476+
.details = analysis_graph_write_details,
34593477
.args = analysis_graph_write_args,
34603478
};
34613479

0 commit comments

Comments
 (0)