Version: 1.3
语言 : 中文
Hilog
Memory

Stacktrace Utility

The Stacktrace Utility tool resolves custom stacktraces to help you debug crashes. You can select Stacktrace Utility tag to open the Stacktrace Utility window.

For more information, you can click the following link to reach directly:

Stacktrace Utility window interface

To open the Stacktrace Utility window:

  1. Open the OpenHarmony Hilog window.
  2. From the tag, select Stacktrace Utility.
Stacktrace Utility
Stacktrace Utility
Area Description
1 Stacktrace display: Contains a text area to enter a custom stacktrace, and a text area to display the resolved stacktrace.
2 Path settings: Contains settings includes symbol paths, stacktrace regex, symbol extensions.

Stacktrace display

The stacktrace display contains two tabs and a button:

  1. Original: A text area that you can copy stacktraces into for the Stacktrace Utility tool to resolve.
  2. Resolved: A text area that the Stacktrace Utility tool populates with the resolved stacktrace you entered into the Original tab.
  3. Resolve Stacktraces: Resolves the stacktrace currently in the Original text area of the stacktrace display then displays the resolved stacktrace in the Resolved text area.

Path settings

Before you use the Stacktrace Utility tool, you must provide it with the resources it requires to resolve stacktraces.

Configure symbol paths

To resolve stacktrace for an application, the Stacktrace Utility tool requires paths to the libmain, libtuanjie, and libil2cpp symbol files. To configure these paths:

Symbol Paths Settings
Symbol Paths Settings
  • Use the default symbol files:
    • In the Symbol Paths, select Add > Tuanjie Version.
    • Select il2cpp and Development or Release.
  • Use the custom symbol files:
    • In the Symbol Paths, select Add > Pick Custom Location.
    • Find the libmain, libunity, and libil2cpp symbol files and add the folder that each of them are within.

Note: When the Stacktrace Utility tool resolves stacktraces, it iterates through the symbol path list and uses the first located version of each symbol file. If you use more than one symbol path, be aware of symbol files with the same file name in multiple folders, because the tool only uses the first one it finds.

Configure stacktrace regex

The Stacktrace Utility tool uses regular expressions to parse entries. By default, the tool contains regular expressions that parse the address and library name from each entry, but you can add your own regular expressions to resolve addresses and library names.

Regex Settings
Regex Settings

To add your own regular expressions, you can enter your regular expression and click Add in the text input field.

Note: From the regular expressions list, the one at the top is used for resolving the function address and library name. If it fails, the next one in the order is used as a fallback. You can modify the order as per your preference.

Configure symbol extensions

Use the Symbol Extensions setting to specify file extensions which are appended to symbol file names during stacktrace resolving.

Symbol Extensions Settings
Symbol Extensions Settings

To add your own regular expressions, you can enter your symbol extensions and click Add in the text input field.

How to resolve a stacktrace

To use the Stacktrace Utility tool to resolve a stacktrace for your application:

  1. Open the Stacktrace Utility window.
  2. Make sure Symbol Paths, Symbol Extensions and Stacktrace Regex are set up correctly.
  3. In the Stacktrace display section, open the Original tab.
  4. Paste your stacktrace into the text area in the Original tab.
  5. Select Resolve Stacktraces.
  6. Open the Resolved tab and view the resolved stacktrace.
Hilog
Memory