Documentation ¶
Overview ¶
Package breakpad processes minidump crash reports created by Breakpad.
See https://chromium.googlesource.com/breakpad/breakpad/ for more details about Breakpad.
Index ¶
- func DownloadLacrosSymbols(url, destDir string) error
- func DownloadSymbols(url, destDir string, files SymbolFileMap) (created int, err error)
- func GetDebugBinaryPath(buildRoot, path string) string
- func GetLacrosSymbolsURL(version string) string
- func GetSymbolFilePath(dir, base, id string) string
- func GetSymbolsURL(builderPath string) string
- func IsMinidump(r io.Reader) (bool, error)
- func ReadCrashReport(r io.Reader) (pairs map[string]string, dumpOffset, dumpLen int, err error)
- type MinidumpReleaseInfo
- type ModuleInfo
- type SymbolFileMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadLacrosSymbols ¶
DownloadLacrosSymbols downloads the specified url and extract symbols to the destDir. On success, exactly one file is created.
func DownloadSymbols ¶
func DownloadSymbols(url, destDir string, files SymbolFileMap) (created int, err error)
DownloadSymbols downloads url (see GetSymbolsURL) and extracts the symbol files specified in files to destDir. The number of files that were created is returned.
func GetDebugBinaryPath ¶
GetDebugBinaryPath returns the absolute path under buildRoot (e.g. "/build/lumpy") where the debug binary should be located for path (e.g. "/bin/grep").
func GetLacrosSymbolsURL ¶
GetLacrosSymbolsURL returns the Cloud Storage URL of the file containing ELF debug symbols of Lacros Chrome for a particular version, for example, "95.0.4637.0".
func GetSymbolFilePath ¶
GetSymbolFilePath returns the path within symbol directory dir where the Breakpad symbol file for the binary with basename base and ModuleInfo.ID id should be located.
func GetSymbolsURL ¶
GetSymbolsURL returns the Cloud Storage URL of the .tar.xz file containing Breakpad debug symbols for builderPath (e.g. "cave-release/R65-10286.0.0").
func IsMinidump ¶
IsMinidump returns true if r (which should be at the beginning of a file) is a minidump file.
func ReadCrashReport ¶
ReadCrashReport reads a ChromeOS crash report file written by Chrome. These files are typically parsed by crash-reporter and use a custom format consisting of repeated colon-separated (key, decimal-value-length, value-data) sequences:
<key>:<decimal-value-length>:<value-data><key>:...
Breakpad minidump data is typically included, and the data's offset and length within the reader is returned separately without being loaded into memory. All other key/value pairs are returned via a map.
See https://chromium.googlesource.com/chromium/src/+/HEAD/components/crash/content/app/breakpad_linux.cc for more details.
Types ¶
type MinidumpReleaseInfo ¶
MinidumpReleaseInfo contain ChromeOS version information extracted from a minidump file. It can contain the contents of /etc/lsb-release, crashpad annotation, or none of the above.
func GetMinidumpReleaseInfo ¶
func GetMinidumpReleaseInfo(f *os.File) (*MinidumpReleaseInfo, error)
GetMinidumpReleaseInfo returns ChromeOS version information extracted from f, a minidump file. Crashpad, which is used by Chrome, includes an annotations dictionary. Other programs use Breakpad, which includes the contents of /etc/lsb-release.
type ModuleInfo ¶
type ModuleInfo struct { // OS identifies the operating system on which the executable or shared library was intended to run. OS string // Arch indicates the processor architecture the executable or shared library contains machine code for. Arch string // ID is an opaque sequence of hexadecimal digits that identifies the exact executable or library whose // contents the symbol file describes. ID string // Name contains the base name (the final component of the directory path) of the executable or library. Name string }
ModuleInfo contains data from a Breakpad symbol file's MODULE record. See https://chromium.googlesource.com/breakpad/breakpad/+/HEAD/docs/symbol_files.md#records-1 for details.
func WriteSymbolFile ¶
func WriteSymbolFile(binPath, outDir string) (*ModuleInfo, error)
WriteSymbolFile writes a Breakpad symbols file for binPath, a binary file with debugging symbols, to the Breakpad-expected location within outDir. Breakpad's dump_syms program must be present.
type SymbolFileMap ¶
SymbolFileMap maps from the full paths of binaries (as absolute on-device paths, e.g. "/usr/lib64/libbase-core-395517.so") to the corresponding symbol file IDs wanted by minidump_stackwalk (i.e. breakpad.ModuleInfo.ID).
func WalkMinidump ¶
func WalkMinidump(path, symDir string, w io.Writer) (missing SymbolFileMap, err error)
WalkMinidump writes a human-readable representation of the stack trace contained within the minidump file at path to w. symDir is a directory containing symbol files that will be used to make a best-effort attempt symbolize the trace. Binaries with missing symbol files are returned.
Minidump's minidump_stackwalk program must be present, and symDir should follow the <module>/<ID>/<module>.sym layout directory expected by it, e.g. libc-2.23.so/7219A63C9901FA247C197BCFED143B110/libc-2.23.so.sym.