Is there any option to have Nim's C backend generate more readable/descriptive mangled function names? Sometimes I have to look at those names, when using native profiling/debugging tools, and they can be very ambiguous. For example, write__UlykqHUJzrYfskoCKJB7AQ is obviously a function named write ... but which one? Sometimes it's clear from the stack backtrace, but not always, especially when the stack dives deep into library code.
I'm assuming the gibberish is a base64 digest of the function signature and maybe the compiler settings too. It'd be nice if, for these purposes, I could temporarily switch to a more C++ like mangling that makes the parameter types [sort of] readable. (I've checked the compiler documentation but didn't find anything.)
One particular problem arises when you have generic procs or templates. As different instantiations uses the same name, the difference in the hash does not help at all.
It would be useful if the generated C identifiers include the instantiated type name.
I was confronted, when switching to gc-arc for typeinfo the compilation did not find any error except for the encapsulation in C. But I quickly understood the mode of operation and the associations with the references (line) of the code. This allowed me to correct;).
As for debugging the module "c" linker that I find that it is not the place with nim ... I only put links on and validated, the debug only serves me for what is written in nim .. . until now the beug are only erroneous values ... on this the development it is found to be strongly added value.
https://github.com/nim-lang/Nim/pull/14632
This PR is in a state where it will benefit from testing and feedback regarding the output. This is an invasive change, so I don't expect it to be merged without more testing than what the compiler suite can supply.
The output is not quite what I had intended, but it's 80% there and IC should take us the remaining 20%.