rizinorg / rz-libdemangle

Rizin Library to demangle symbols
7 stars 6 forks source link

Add support for _block_invoke in c++ and objc #46

Closed wargio closed 1 year ago

wargio commented 1 year ago

SQUASH ME

Describes function blocks that don't have a name specified in source code. Ex: _ZN1Parent_Funciton_block_invoke_1

https://reviews.llvm.org/D74813

XVilka commented 1 year ago

Many these warnings:

../subprojects/libdemangle/src/demangler_util.c: assertion 'ds && string' failed (line 169)
XVilka commented 1 year ago

@wargio it solved the original problem, thanks!

wargio commented 1 year ago

they are indeed not demangled. could you provide the original strings?

XVilka commented 1 year ago

@wargio not sure if these are originals (got them with rizin -e bin.demangle=false):

[0x100006060]> is~XPCAgent~__
89   0x0004caf8 0x100008af8 LOCAL  FUNC 0        ___32+[XPCAgentServer sharedInstance]_block_invoke
91   0x0004ccbc 0x100008cbc LOCAL  FUNC 0        ___53-[XPCAgentServer listener:shouldAcceptNewConnection:]_block_invoke
92   0x0004cd28 0x100008d28 LOCAL  FUNC 0        ___53-[XPCAgentServer listener:shouldAcceptNewConnection:]_block_invoke.46
97   0x0004d46c 0x10000946c LOCAL  FUNC 0        ___55-[XPCAgentServer notifyUser:noticeId:notificationType:]_block_invoke
102  0x0004e058 0x10000a058 LOCAL  FUNC 0        ___59-[XPCAgentServer activateUniversalAccessAuthWarn:interval:]_block_invoke
104  0x0004e2bc 0x10000a2bc LOCAL  FUNC 0        ___27-[XPCAgentServer launchApp]_block_invoke
105  0x0004e3d4 0x10000a3d4 LOCAL  FUNC 0        ___27-[XPCAgentServer launchApp]_block_invoke.118
109  0x0004e898 0x10000a898 LOCAL  FUNC 0        ___25-[XPCAgentServer restart]_block_invoke
260  0x000565e8 0x1000125e8 LOCAL  FUNC 0        __OBJC_$_CLASS_METHODS_XPCAgentServer
261  0x00056600 0x100012600 LOCAL  FUNC 0        __OBJC_$_INSTANCE_METHODS_XPCAgentServer
426  0x00060d18 0x10001cd18 LOCAL  FUNC 0        __OBJC_CLASS_PROTOCOLS_$_XPCAgentServer
427  0x00060d30 0x10001cd30 LOCAL  FUNC 0        __OBJC_METACLASS_RO_$_XPCAgentServer
428  0x00060d78 0x10001cd78 LOCAL  FUNC 0        __OBJC_$_INSTANCE_VARIABLES_XPCAgentServer
429  0x00060dc0 0x10001cdc0 LOCAL  FUNC 0        __OBJC_$_PROP_LIST_XPCAgentServer
430  0x00060e28 0x10001ce28 LOCAL  FUNC 0        __OBJC_CLASS_RO_$_XPCAgentServer
wargio commented 1 year ago

@XVilka can you try again?

wargio commented 1 year ago

Nice!