Is it any way to add .map file as resource of the project when compiling?
<p>I'd like to add the map file as resource, then extract the file every time that execute the system, to ensure that the map file is always right, and make the life of support easier. In Delphi 7 I can compile the project, with the map file as resource, but the map is wrong, because when an exception is raised the call stack is wrong. In Delphi Seattle, I can't even compile, because it tries to add the resource before generate the map. I know that I can add the file in a post-compile thask, but is there any way to do it in compiling/building time?
Sorry if I'm not very specific, that's my first question here. Thanks. </p>

<p><strong>UPDATE</strong> </p>

<p>After I read some answers, I did some research. I was already using JEDI exception unit in my project, but I did not know the JEDI Debug expert. It does exactly what I want and more.
JEDI Debug expert convert a .map file to .jdbg file, wich is an encrypted file of map (map is just a text file). Also, the jdbg file is about <strong>12% smaller</strong> then the map. It also has the options to <strong>insert the jdbg into binary (exe)</strong>. To do that, I enabled the options:</p>

<ul>
<li><p>Project -> JCL Debug expert -> Generate .jdbg files -> Enabled for this project</p></li>
<li><p>Project -> JCL Debug expert -> Insert jdbg data into binary -> Enabled for this project</p></li>
<li><p>Project -> JCL Debug expert -> Delete map files after conversion -> Enabled for this project (if you want to delete the file, of course) </p></li>
</ul>

<p>To use this tool outside the IDE, with Jenkins for example, I had to build the project available in <strong>JEDI\jcl\examples\windows\debug\tools\MakeJclDbg.dpr</strong>. After build, it will generate the exe file in the bin directory of jcl. How to use: </p>

<p>MakeJclDbg -J -E -M map_filename</p>

<p>J - Create .JDBG files</p>

<p>E - Insert debug data into executable files</p>

<p>M - Delete MAP file after conversion</p>

<p>Executable files must be in the same directory as the MAP files. This will create the jdbg file (based in the map file), insert into the exe and delete the map. With this (and with the exception unit of JEDI), when an exception is raised, It's available to me the stack trace, the versions of all dll's used by the system, operation system info, and more, and also send all this to an email. </p>

<p>I realised that Embarcadero also have jdbg files of theirs bpl, so I think they use JCL tool as well. </p>