Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
44f96d44
Commit
44f96d44
authored
Apr 15, 2014
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addr2line, objdump: write doc comments
LGTM=r R=r CC=golang-codereviews
https://golang.org/cl/88050046
parent
22505cd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
4 deletions
+39
-4
src/cmd/addr2line/main.go
src/cmd/addr2line/main.go
+13
-2
src/cmd/objdump/main.go
src/cmd/objdump/main.go
+26
-2
No files found.
src/cmd/addr2line/main.go
View file @
44f96d44
...
...
@@ -2,8 +2,19 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// addr2line simulation - only enough to make pprof work on Macs
// Addr2line is a minimal simulation of the GNU addr2line tool,
// just enough to support pprof.
//
// Usage:
// go tool addr2line binary
//
// Addr2line reads hexadecimal addresses, one per line and without a 0x prefix,
// from standard input. For each input address, addr2line prints two output lines,
// first the name of the function containing the address and second the file:line
// of the source code corresponding to that address.
//
// This tool is intended for use only by pprof; its interface may change or
// it may be deleted entirely in future releases.
package
main
import
(
...
...
src/cmd/objdump/main.go
View file @
44f96d44
...
...
@@ -2,8 +2,31 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// objdump simulation - only enough to make pprof work on Macs
// Objdump is a minimal simulation of the GNU objdump tool,
// just enough to support pprof.
//
// Usage:
// go tool objdump binary start end
//
// Objdump disassembles the binary starting at the start address and
// stopping at the end address. The start and end addresses are program
// counters written in hexadecimal without a leading 0x prefix.
//
// It prints a sequence of stanzas of the form:
//
// file:line
// address: assembly
// address: assembly
// ...
//
// Each stanza gives the disassembly for a contiguous range of addresses
// all mapped to the same original source file and line number.
//
// The disassembler is missing (golang.org/issue/7452) but will be added
// before the Go 1.3 release.
//
// This tool is intended for use only by pprof; its interface may change or
// it may be deleted entirely in future releases.
package
main
import
(
...
...
@@ -22,6 +45,7 @@ import (
func
printUsage
(
w
*
os
.
File
)
{
fmt
.
Fprintf
(
w
,
"usage: objdump binary start end
\n
"
)
fmt
.
Fprintf
(
w
,
"disassembles binary from start PC to end PC.
\n
"
)
fmt
.
Fprintf
(
w
,
"start and end are hexadecimal numbers with no 0x prefix.
\n
"
)
}
func
usage
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment