RLPLite Function Generator
I have been bitten a few times now that the address of one or more RLP functions change and I forget to update the addresses in the C# code.
So I threw together this quick and dirty utility that parses the GCC map file and generates the C# proxies. I include this in my build script so that after each compile of the native code the map file is parsed and the C# file is generated.
It is currently hard coded to look for functions in the map file that are prefixed with ‘RLP_’, you can tweak that matching of the functions by adjusting the regular expression used to match the function.
Usage:
RLPProxyGen
Where:
mapfile GCC map file to parse for RLP functions
outputfile Name of the C# file to create from the map
className Name of the C# class that will contain the functions
In my build script I have the following execute if the build GCC succeeded
RLPProxyGen Output\RLP1.map …\Managed\MyApp\RLPMethods.cs RLPMethods
This will scan the RLP1.map file and generate the RLPMethods file with a static class called RLPMethods which contains the RLP entry points. Please see the usage example for an example of the generated class.
This is by no means a robust tool, but it does the job for what I am currently doing ie. RLPLite on the Hydra. As I find things that are useful in my build workflow I will update this if required.