If you use some of our Open Source classes, you can find the name of any character.
You need to create a .map file when creating your executable file by setting the "Detailed map" option in your project.
You can then send the .map using .exe or compress the .map into our own .mab format, which you can add to the .exe . The .mab format .mab much more efficient than .zip or another for this task: it is about 10 times smaller than the original .map file (that is, much smaller than the JCLDebug or MaxExpect suggestions, and much smaller than using the standard implementation of the Remote Debugging Symbol implementation project ").
Then you can use the TSynMapFile class to get debugging information from a .map file or information embedded in .exe :
function ExtractName(aSymbolAddress: pointer): string; var i: integer; begin with TSynMapFile.Create do // no name supplied -> will read from .exe try i := FindSymbol(aSymbolAddress); if i>=0 then result := Symbols[i].Name else result := ''; finally Free; end; end;
It will work for function names, as well as any other characters, such as methods or global variables.
See this blog post about the class. Please note that even if it is used by our mORMot framework or its logging features, you just donβt need to use the whole structure (just SynCommons.pas and SynLZ.pas ). See Map2Mab.dpr in the SQLite3 \ Samples \ 11 - Exception logging subdirectory to insert the contents of the .map file into the .exe file.
source share