mirror of
https://github.com/golang/go
synced 2024-11-18 12:24:48 -07:00
d30e00c240
splitdwarf osxMachoFile [ osxDsymFile ] splitdwarf takes an executable produced by go build as input, and uncompresses and copies the DWARF segment into a separate file in the way that is expected by OSX-hosted tools (lldb and ports of gdb). If osxDsymFile is not named explicitly, the default of "<osxMachoFile>.dSYM/Contents/Resources/DWARF/<osxMachoFile>" is used instead, with directories created as needed. If the input file contains no UUID, then one is created by hashing non-DWARF segment contents, and added to the executable. This is necessary because gdb and lldb both expect matching UUIDs to be present in the executable and its debugging symbols. Includes a modified version of debug/macho, with additional definitions and the ability to write segments, sections, and some MachO load commands added. Change-Id: Ia5b0e289260f72bbca392cdf2c7c0a75e3ca40e5 Reviewed-on: https://go-review.googlesource.com/c/143357 Reviewed-by: Austin Clements <austin@google.com>
20 lines
629 B
Go
20 lines
629 B
Go
// Copyright 2018 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
/*
|
|
|
|
Splitdwarf uncompresses and copies the DWARF segment of a Mach-O
|
|
executable into the "dSYM" file expected by lldb and ports of gdb
|
|
on OSX.
|
|
|
|
Usage: splitdwarf osxMachoFile [ osxDsymFile ]
|
|
|
|
Unless a dSYM file name is provided on the command line,
|
|
splitdwarf will place it where the OSX tools expect it, in
|
|
"<osxMachoFile>.dSYM/Contents/Resources/DWARF/<osxMachoFile>",
|
|
creating directories as necessary.
|
|
|
|
*/
|
|
package main // import "golang.org/x/tools/cmd/splitdwarf"
|