10 #define DEFINE_DEMANGLER_PLUGIN(name, lang, lic, auth, handler) \
11 RZ_API RzDemanglerPlugin rz_demangler_plugin_##name = { \
15 .demangle = &handler, \
23 #if WITH_SWIFT_DEMANGLER
47 return libdemangle_handler_cxx(symbol);
100 const char *lang =
p->language ?
p->language :
"";
101 RZ_LOG_WARN(
"rz_demangler: failed to add '%s' plugin at index %u", lang,
i);
132 rz_list_foreach (dem->plugins, it, plugin) {
133 if (!
iter(plugin, data)) {
152 rz_list_foreach (dem->plugins, it, cp) {
153 if (!strcmp(cp->
language, plugin->language)) {
173 rz_list_foreach (dem->plugins, it, plugin) {
174 if (!strcmp(language, plugin->
language)) {
198 rz_list_foreach (dem->plugins, it, plugin) {
199 if (!strcmp(plugin->
language, language)) {
#define RZ_DEMANGLER_STATIC_PLUGINS
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API RZ_OWN char * rz_demangler_cxx(RZ_NONNULL const char *symbol)
Demangles c++ symbols.
RZ_API RZ_OWN char * rz_demangler_objc(RZ_NONNULL const char *symbol)
Demangles objc symbols.
RZ_API RZ_OWN RzDemangler * rz_demangler_new(void)
Initializes the plugin list and returns a RzDemangler struct.
RZ_API RZ_OWN char * rz_demangler_msvc(RZ_NONNULL const char *symbol)
Demangles microsft vc symbols.
RZ_API RZ_OWN char * rz_demangler_java(RZ_NULLABLE const char *symbol)
Demangles java symbols.
RZ_LIB_VERSION(rz_demangler)
RZ_API RZ_OWN char * rz_demangler_rust(RZ_NONNULL const char *symbol)
Demangles rust symbols.
RZ_API void rz_demangler_free(RZ_NULLABLE RzDemangler *dem)
Frees the RzDemangler struct.
RZ_API bool rz_demangler_plugin_add(RZ_NONNULL RzDemangler *dem, RZ_NONNULL RzDemanglerPlugin *plugin)
Adds a new demangler plugin to the plugin list.
RZ_API bool rz_demangler_resolve(RZ_NONNULL RzDemangler *dem, RZ_NULLABLE const char *symbol, RZ_NONNULL const char *language, RZ_NONNULL RZ_OWN char **output)
Resolves a symbol based on its language and return an output that needs to be freed.
#define DEFINE_DEMANGLER_PLUGIN(name, lang, lic, auth, handler)
RZ_API void rz_demangler_plugin_iterate(RZ_NONNULL RzDemangler *dem, RZ_NONNULL RzDemanglerIter iter, RZ_NULLABLE void *data)
Iterates over the plugin list.
RZ_API RZ_BORROW const RzDemanglerPlugin * rz_demangler_plugin_get(RZ_NONNULL RzDemangler *dem, RZ_NONNULL const char *language)
Returns a demangler plugin pointer based on the language that is found.
static RzDemanglerPlugin * demangler_static_plugins[]
RZ_API void rz_list_delete(RZ_NONNULL RzList *list, RZ_NONNULL RzListIter *iter)
Removes an entry in the list by using the RzListIter pointer.
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
char * libdemangle_handler_rust(const char *sym)
#define rz_warn_if_fail(expr)
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
bool(* RzDemanglerIter)(const RzDemanglerPlugin *plugin, void *data)
RZ_API char * libdemangle_handler_msvc(const char *symbol)
RZ_API char * libdemangle_handler_objc(const char *symbol)
RZ_API char * libdemangle_handler_java(const char *symbol)
Demangles java classes/methods/fields.
#define RZ_LOG_WARN(fmtstr,...)
#define RZ_STR_ISNOTEMPTY(x)
#define RZ_STR_ISEMPTY(x)
const char * language
demangler language
RZ_OWN char *(* demangle)(RZ_NONNULL const char *symbol)
demangler method to resolve the mangled symbol
char * libdemangle_handler_swift(const char *s)