首页 > 代码库 > Map Data to Source Code

Map Data to Source Code

Map Data to Source Code

仪器需要有关项目的准确信息以提供最佳结果。如果系统可以看到与项目相关联的所有符号,则获得最完整的信息。当由工具分析工具生成的跟踪文档中显示地址而不是符号时,您可以手动提供丢失的信息。地址到符号的映射是包含在一个dsym文件。通常情况下,仪器自动发现dsym文件,基于你在聚光灯的指标和仪器的喜好指定路径的位置。然而,你可以点工具在正确的方向,当它不能自动找到一个dsym。一旦完成,仪器就可以将地址映射到相关联的符号和行号信息。Instruments requires accurate information about your project to provide the best results. You get the most complete information if the system can see all symbols associated with your project. When addresses, rather than symbols, are displayed in trace documents generated by the Instruments analysis tool, you can manually provide the missing information. The mapping of addresses to their symbols is contained in a dSYM file. Typically, Instruments finds dSYM files automatically, based on the locations that Spotlight indexes and the paths you specify in Instruments preferences. However, you can point Instruments in the right direction when it can’t automatically find a dSYM. Once you do, Instruments can map addresses to their associated symbols and line number information.

要找到一个可执行文件或框架的dsym路径To locate the dSYM path for an executable or framework
  1. Choose File > Symbols.

    技术分享

    此命令仅在运行跟踪或加载先前保存的跟踪之后才显示。This command appears only after you run a trace or load a previously saved trace.

  2. 选择缺少符号的可执行(二进制)或框架。Select the executable (binary) or framework that is missing symbols.

    技术分享
  3. 单击“定位”按钮。Click the Locate button.

    技术分享
  4. 在出现的对话框中,选择您的符号文件或包含它的文件夹。In the dialog that appears, select your symbol file or the folder that contains it.

  5. Click Open.

为了正确显示跟踪文档中的符号,仪器需要访问生成测试的可执行文件时生成的特定符号文件。因此,您可能需要手动定位dsym文件当你建立一个计算机和测试性能的另一个。To correctly display symbols in trace documents, Instruments needs access to the specific symbol files that were generated when the executable you are testing was built. Therefore, you may need to manually locate a dSYM file when you build on one computer and test performance on another.

符号对话框中的过滤条允许您执行可执行的和不完整的二进制文件和框架。您还可以通过在搜索字段中输入文本来搜索特定的二进制或框架。The filter bar in the Symbols dialog lets you filter by executable and incomplete binaries and frameworks. You can also search for a specific binary or framework by entering text in the search field.

NOTE

默认情况下,Xcode保存符号作为dsym束在建立文件夹。Xcode创建默认的dsym束路径添加到可执行文件的名称dsym延伸。产生dsym束在Xcode,去建立设置区域为您的项目,并选择在选项部分dsym文件调试信息格式>矮。By default, Xcode saves symbols as dSYM bundles in the Build folder. Xcode creates the default dSYM bundle path by adding the extension .dSYM to the executable name. To generate dSYM bundles in Xcode, go to the Build Settings area for your project, and select Debug Information Format > Dwarf with dSYM File in the Build Options section.

CAUTION

通常,当一个地址显示而不是一个符号时,地址出现在左边的黑色和右边的灰色窗格中右边的拥有的库中。你可以通过定位合适的dsym文件识别这些地址。Typically, when an address is displayed instead of a symbol, the address appears in black on the left and the owning library in gray on the right in the detail pane. You can identify these addresses by locating the appropriate dSYM file.

如果地址是灰色的,并且没有列出所属的库,则不能显示符号名称。没有库名称的灰色地址意味着在跟踪记录时,您没有权限查看关于该过程的信息。当生成设置中的代码签名标识设置为发布版本的发布/分发标识时,这通常会发生。您的版本构建应该使用与调试生成相同的设置(通常是“IOS开发人员”)。If the address is gray and no owning library is listed, you cannot display the symbolic name. A gray address with no library name means that at the time the trace was recorded, you did not have permission to see information about that process. This typically occurs when the Code Signing Identity in your build settings is set to a release/distribution identity for Release builds. Your Release build should use the same setting as your Debug build (typically, “iOS Developer”).

Map Data to Source Code