Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
6 changed files
with
1,418 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.