diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-03-03 23:32:42 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-03-03 23:33:38 (GMT) |
commit | d0314437fcad499f45a4bdb93d085100cee2c70b (patch) | |
tree | 8c77605d56f0d603de73d5f24be0aba972db5959 /src/analysis/routine.c | |
parent | 0c638aecff9482b93621d77279ac77a8788584e9 (diff) |
Handled destructors properly when demangling C++ Itanium names.
Diffstat (limited to 'src/analysis/routine.c')
-rw-r--r-- | src/analysis/routine.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/analysis/routine.c b/src/analysis/routine.c index 8c38ff1..240004f 100644 --- a/src/analysis/routine.c +++ b/src/analysis/routine.c @@ -826,12 +826,11 @@ char *g_binary_routine_to_string(const GBinRoutine *routine, bool include) { case RTT_CONSTRUCTOR: result = g_binary_routine_get_label(routine); - result = stradd(result, "." /* FIXME */); + result = stradd(result, " *"); break; case RTT_DESTRUCTOR: - result = g_binary_routine_get_label(routine); - result = stradd(result, "::~"); + result = strdup("void "); break; default: /* Pour gcc */ @@ -863,17 +862,35 @@ char *g_binary_routine_to_string(const GBinRoutine *routine, bool include) } if (routine->full_name != NULL) - { name = g_data_type_to_string(routine->full_name, true); - result = stradd(result, name); + else if (routine->name != NULL) + name = routine->name; - free(name); + switch (routine->type) + { + case RTT_CONSTRUCTOR: + result = stradd(result, name); + result = stradd(result, routine->ns_sep); + result = stradd(result, name); + break; + + case RTT_DESTRUCTOR: + result = stradd(result, name); + result = stradd(result, routine->ns_sep); + result = stradd(result, "~"); + result = stradd(result, name); + break; + + default: /* Pour gcc */ + case RTT_CLASSIC: + result = stradd(result, name); + break; } - else if (routine->name != NULL) - result = stradd(result, routine->name); + if (routine->full_name != NULL) + free(name); /* Liste des arguments */ |