Package xcrash

Class TombstoneParser


  • public class TombstoneParser
    extends java.lang.Object
    Tombstone (crash) log file parser.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String keyAbi
      Current ABI.
      static java.lang.String keyAbiList
      Supported ABI list.
      static java.lang.String keyAbortMessage
      Native crash abort message.
      static java.lang.String keyApiLevel
      Android API level.
      static java.lang.String keyAppId
      The name of this application's package.
      static java.lang.String keyAppVersion
      The version name of this package.
      static java.lang.String keyBacktrace
      Native crash backtrace.
      static java.lang.String keyBrand
      Brand.
      static java.lang.String keyBuildFingerprint
      Build fingerprint.
      static java.lang.String keyBuildId
      Native crash ELF's build-id and file size.
      static java.lang.String keyCode
      Native crash signal code.
      static java.lang.String keyCrashTime
      Crash or ANR time.
      static java.lang.String keyCrashType
      Crash type.
      static java.lang.String keyFaultAddr
      Native crash fault address.
      static java.lang.String keyForeground
      Is the app at the foreground? ("yes" or "no")
      static java.lang.String keyJavaStacktrace
      Native crash thread's Java stacktrace from JVM, or Java exception stacktrace.
      static java.lang.String keyKernelVersion
      Linux kernel version.
      static java.lang.String keyLogcat
      Logcat.
      static java.lang.String keyManufacturer
      Manufacturer.
      static java.lang.String keyMemoryInfo
      Memory info.
      static java.lang.String keyMemoryMap
      Native crash memory map.
      static java.lang.String keyMemoryNear
      Native crash memory near information.
      static java.lang.String keyModel
      Model.
      static java.lang.String keyNetworkInfo
      Network info.
      static java.lang.String keyOpenFiles
      FD list.
      static java.lang.String keyOsVersion
      Android OS version.
      static java.lang.String keyOtherThreads
      Other threads information for native crash, or traces which including all threads information for ANR.
      static java.lang.String keyProcessId
      Process ID.
      static java.lang.String keyProcessName
      Process name.
      static java.lang.String keyRegisters
      Native crash registers values.
      static java.lang.String keyRooted
      Whether this device has been rooted(jailbroken).
      static java.lang.String keySignal
      Native crash signal name.
      static java.lang.String keyStack
      Native crash stack.
      static java.lang.String keyStartTime
      APP Start time (xCrash initialized time).
      static java.lang.String keyThreadId
      Thread ID.
      static java.lang.String keyThreadName
      Thread name.
      static java.lang.String keyTombstoneMaker
      The tombstone file maker's library name and version.
      static java.lang.String keyXCrashError
      Error code from xCrash itself.
      static java.lang.String keyXCrashErrorDebug
      Error message from xCrash itself.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.String> parse​(java.io.File log)
      Parse a crash log file into an instance of Map.
      static java.util.Map<java.lang.String,​java.lang.String> parse​(java.lang.String logPath)
      Parse a crash log file into an instance of Map.
      static java.util.Map<java.lang.String,​java.lang.String> parse​(java.lang.String logPath, java.lang.String emergency)
      Parse a crash log file (with an emergency buffer) into an instance of Map.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • keyTombstoneMaker

        public static final java.lang.String keyTombstoneMaker
        The tombstone file maker's library name and version.
        See Also:
        Constant Field Values
      • keyCrashType

        public static final java.lang.String keyCrashType
        Crash type. ("java" or "native" or "anr")
        See Also:
        Constant Field Values
      • keyStartTime

        public static final java.lang.String keyStartTime
        APP Start time (xCrash initialized time). (Format: "yyyy-MM-dd'T'HH:mm:ss.SSSZ")
        See Also:
        Constant Field Values
      • keyCrashTime

        public static final java.lang.String keyCrashTime
        Crash or ANR time. (Format: "yyyy-MM-dd'T'HH:mm:ss.SSSZ")
        See Also:
        Constant Field Values
      • keyAppId

        public static final java.lang.String keyAppId
        The name of this application's package. (From: Context.getPackageName())
        See Also:
        Constant Field Values
      • keyRooted

        public static final java.lang.String keyRooted
        Whether this device has been rooted(jailbroken). ("Yes" or "No")
        See Also:
        Constant Field Values
      • keyApiLevel

        public static final java.lang.String keyApiLevel
        Android API level. (From: Build.VERSION.SDK_INT)
        See Also:
        Constant Field Values
      • keyOsVersion

        public static final java.lang.String keyOsVersion
        Android OS version. (From: Build.VERSION.RELEASE)
        See Also:
        Constant Field Values
      • keyKernelVersion

        public static final java.lang.String keyKernelVersion
        Linux kernel version.
        See Also:
        Constant Field Values
      • keyAbiList

        public static final java.lang.String keyAbiList
        Supported ABI list. (From: Build.SUPPORTED_ABIS)
        See Also:
        Constant Field Values
      • keyManufacturer

        public static final java.lang.String keyManufacturer
        Manufacturer. (From: Build.MANUFACTURER)
        See Also:
        Constant Field Values
      • keyBrand

        public static final java.lang.String keyBrand
        Brand. (From: Build.BRAND)
        See Also:
        Constant Field Values
      • keyModel

        public static final java.lang.String keyModel
        Model. (From: Build.MODEL)
        See Also:
        Constant Field Values
      • keyBuildFingerprint

        public static final java.lang.String keyBuildFingerprint
        Build fingerprint. (From: Build.FINGERPRINT)
        See Also:
        Constant Field Values
      • keyAbi

        public static final java.lang.String keyAbi
        Current ABI. ("arm" or "arm64" or "x86" or "x86_64")
        See Also:
        Constant Field Values
      • keyProcessId

        public static final java.lang.String keyProcessId
        Process ID.
        See Also:
        Constant Field Values
      • keyThreadId

        public static final java.lang.String keyThreadId
        Thread ID.
        See Also:
        Constant Field Values
      • keyProcessName

        public static final java.lang.String keyProcessName
        Process name.
        See Also:
        Constant Field Values
      • keyThreadName

        public static final java.lang.String keyThreadName
        Thread name.
        See Also:
        Constant Field Values
      • keySignal

        public static final java.lang.String keySignal
        Native crash signal name.
        See Also:
        Constant Field Values
      • keyCode

        public static final java.lang.String keyCode
        Native crash signal code.
        See Also:
        Constant Field Values
      • keyFaultAddr

        public static final java.lang.String keyFaultAddr
        Native crash fault address.
        See Also:
        Constant Field Values
      • keyAbortMessage

        public static final java.lang.String keyAbortMessage
        Native crash abort message.
        See Also:
        Constant Field Values
      • keyRegisters

        public static final java.lang.String keyRegisters
        Native crash registers values.
        See Also:
        Constant Field Values
      • keyBacktrace

        public static final java.lang.String keyBacktrace
        Native crash backtrace.
        See Also:
        Constant Field Values
      • keyBuildId

        public static final java.lang.String keyBuildId
        Native crash ELF's build-id and file size.
        See Also:
        Constant Field Values
      • keyStack

        public static final java.lang.String keyStack
        Native crash stack.
        See Also:
        Constant Field Values
      • keyMemoryNear

        public static final java.lang.String keyMemoryNear
        Native crash memory near information.
        See Also:
        Constant Field Values
      • keyMemoryMap

        public static final java.lang.String keyMemoryMap
        Native crash memory map.
        See Also:
        Constant Field Values
      • keyOpenFiles

        public static final java.lang.String keyOpenFiles
        FD list.
        See Also:
        Constant Field Values
      • keyNetworkInfo

        public static final java.lang.String keyNetworkInfo
        Network info.
        See Also:
        Constant Field Values
      • keyMemoryInfo

        public static final java.lang.String keyMemoryInfo
        Memory info. (From: /proc/PID/smaps)
        See Also:
        Constant Field Values
      • keyOtherThreads

        public static final java.lang.String keyOtherThreads
        Other threads information for native crash, or traces which including all threads information for ANR.
        See Also:
        Constant Field Values
      • keyJavaStacktrace

        public static final java.lang.String keyJavaStacktrace
        Native crash thread's Java stacktrace from JVM, or Java exception stacktrace.
        See Also:
        Constant Field Values
      • keyXCrashError

        public static final java.lang.String keyXCrashError
        Error code from xCrash itself.
        See Also:
        Constant Field Values
      • keyForeground

        public static final java.lang.String keyForeground
        Is the app at the foreground? ("yes" or "no")
        See Also:
        Constant Field Values
      • keyXCrashErrorDebug

        public static final java.lang.String keyXCrashErrorDebug
        Error message from xCrash itself.
        See Also:
        Constant Field Values
    • Method Detail

      • parse

        public static java.util.Map<java.lang.String,​java.lang.String> parse​(java.io.File log)
                                                                            throws java.io.IOException
        Parse a crash log file into an instance of Map. Map's string keys are defined in TombstoneParser.
        Parameters:
        log - Object of the crash log file.
        Returns:
        The parsed map.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • parse

        public static java.util.Map<java.lang.String,​java.lang.String> parse​(java.lang.String logPath)
                                                                            throws java.io.IOException
        Parse a crash log file into an instance of Map. Map's string keys are defined in TombstoneParser.
        Parameters:
        logPath - Absolute path of the crash log file.
        Returns:
        The parsed map.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • parse

        public static java.util.Map<java.lang.String,​java.lang.String> parse​(java.lang.String logPath,
                                                                                   java.lang.String emergency)
                                                                            throws java.io.IOException
        Parse a crash log file (with an emergency buffer) into an instance of Map. Map's string keys are defined in TombstoneParser.

        Note: This method is generally used in ICrashCallback.onCrash(String, String).

        Parameters:
        logPath - Absolute path of the crash log file.
        emergency - A buffer that holds basic crash information when disk exhausted.
        Returns:
        The parsed map.
        Throws:
        java.io.IOException - If an I/O error occurs.