binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

`--print-function-map` performs strange escaping on symbol name

Open sbc100 opened this issue 5 months ago • 4 comments

See https://github.com/emscripten-core/emscripten/issues/24982.

e.g if my function has the name Namespace::foo(Namespace::SomeClass) in the name section the emitted symbol map file will contain:

2:Namespace::foo\28Namespace::SomeClass\29

sbc100 avatar Aug 26 '25 00:08 sbc100

I think we should stop using this on the emscripten side so maybe we can just remove this flag?

sbc100 avatar Aug 26 '25 00:08 sbc100

I don't follow, how can we stop using this from the emscripten side? What would emscripten use instead?

Looking into the escaping, it seems the Names section has (), but Binaryen escapes it so it is a valid wat name. It then uses that in the IR. And --print-function-map prints out the names from the IR.

kripken avatar Aug 26 '25 15:08 kripken

Emscripten can just dump the names itself I think: https://github.com/emscripten-core/emscripten/pull/25053. Should be faster too.

sbc100 avatar Aug 26 '25 15:08 sbc100

Oh right... good idea.

kripken avatar Aug 26 '25 17:08 kripken