如何在Delphi XE6中为Android应用程序创建调试映射文件? [英] How to create debug map file for Android app in Delphi XE6?
问题描述
我已经使用 https://Posix.Backtrace为在XE6中编译的android应用实现了向后跟踪. ://bitbucket.org/shadow_cs/delphi-arm-backtrace .现在,我得到了回溯,但没有行号.
I have implemented a back trace for my android app compiled in XE6 using the Posix.Backtrace from https://bitbucket.org/shadow_cs/delphi-arm-backtrace. As it is now I get the backtrace but not the line numbers.
我正在寻找为我的android创建映射文件,以便可以在运行时将地址提供给addr2line,以便我的错误报告将包含行号.
I am looking to create the map file for my android .so so that I can feed the addresses at runtime to addr2line so that my bug report will contain the line numbers.
我选择了
项目>选项> Delphi编译器>链接.
Project > Options > Delphi Compiler > Linking.
如果选择了Android平台,则地图文件没有选项.选择所有配置Android似乎已明确排除在外:仅适用于Map File ARM,iOS Device Platform;仅限32位Windows,OSx,iOS模拟器的地图文件.无论如何,我都尝试过关闭优化并打开调试,但没有.map文件.
There is no option for map file if Android Platform is selected. Selecting All Configurations Android seems explicitly excluded: Map File ARM, iOS Device Platform only; Map file, 32-bitWindows, OSx, iOS simulator only. I tried it anyway with optimization off, and debug on, and got no .map file.
是否可以在Delphi中为Android应用程序创建.map文件?
Is there a way to create a .map file for an Android app in Delphi?
谢谢!
推荐答案
如果运行RAD Studio命令提示符并调用dccaarm.exe,您将看到,尽管IDE不提供它,编译器仍支持-G
和-GD
命令行开关,它们都发出一个映射文件.
If you run up a RAD Studio Command Prompt and invoke dccaarm.exe you will see that despite the IDE not surfacing it, the compiler supports the -G
and -GD
command-line switches, both of which emit a map file.
调用项目选项对话框(Ctrl+Shift+F11
),然后在选项树中选择"Delphi编译器",编译".现在,选择其他选项",其他选项"以传递给编译器并输入-G
Invoke the project options dialog (Ctrl+Shift+F11
) and in the options tree choose Delphi Compiler, Compiling. Now select Other options, Additional options to pass to the compiler and enter -G
重新编译您的项目,然后将生成一个地图文件,例如project_folder \ Android \ Debug \ libProject1.so.map
Recompile your project and a map file will be produced, e.g. project_folder\Android\Debug\libProject1.so.map
请注意,我正在查看的Delphi 10.1 Berlin中仍然没有IDE链接器选项-该问题与Delphi XE7有关,因此上面概述的某些步骤中的某些细节可能需要稍作调整.
Note, the IDE linker option is still absent in Delphi 10.1 Berlin, which I'm looking at - the question relates to Delphi XE7 and so some of the specifics of the steps outlined above may need minor tweaking.
这篇关于如何在Delphi XE6中为Android应用程序创建调试映射文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!