Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose save_parsed_type() as an API call for Cutter #13149

Merged
merged 2 commits into from
Feb 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions libr/core/cmd_type.c
Original file line number Diff line number Diff line change
@@ -383,10 +383,8 @@ static void save_parsed_type_size(RCore *core, const char *parsed) {
}
}

static void save_parsed_type(RCore *core, const char *parsed) {
if (!core || !core->anal || !parsed) {
return;
}
R_API void r_core_save_parsed_type(RCore *core, const char *parsed) {
r_return_if_fail (core && core->anal && parsed);
// First, if this exists, let's remove it.
char *type = strdup (parsed);
if (type) {
@@ -1214,7 +1212,7 @@ static int cmd_type(void *data, const char *input) {
char *out = r_parse_c_string (core->anal, tmp, &error_msg);
if (out) {
// r_cons_strcat (out);
save_parsed_type (core, out);
r_core_save_parsed_type (core, out);
free (out);
}
if (error_msg) {
@@ -1228,7 +1226,7 @@ static int cmd_type(void *data, const char *input) {
char *out = r_parse_c_file (core->anal, filename, &error_msg);
if (out) {
//r_cons_strcat (out);
save_parsed_type (core, out);
r_core_save_parsed_type (core, out);
free (out);
}
if (error_msg) {
@@ -1265,7 +1263,7 @@ static int cmd_type(void *data, const char *input) {
char *error_msg = NULL;
char *out = r_parse_c_string (core->anal, tmp, &error_msg);
if (out) {
save_parsed_type (core, out);
r_core_save_parsed_type (core, out);
free (out);
}
if (error_msg) {
1 change: 1 addition & 0 deletions libr/include/r_core.h
Original file line number Diff line number Diff line change
@@ -497,6 +497,7 @@ R_API RList *r_core_get_func_args(RCore *core, const char *func_name);
R_API void r_core_print_func_args(RCore *core);
R_API char *resolve_fcn_name(RAnal *anal, const char * func_name);

R_API void r_core_save_parsed_type(RCore *core, const char *parsed);
R_API int r_core_get_stacksz (RCore *core, ut64 from, ut64 to);

/* anal.c */