1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // The godex command prints (dumps) exported information of packages
6 // or selected package objects.
8 // In contrast to godoc, godex extracts this information from compiled
9 // object files. Hence the exported data is truly what a compiler will
10 // see, at the cost of missing commentary.
12 // Usage: godex [flags] {path[.name]}
14 // Each argument must be a (possibly partial) package path, optionally
15 // followed by a dot and the name of a package object:
19 // godex math.Sin fmt.Printf
22 // godex automatically tries all possible package path prefixes if only a
23 // partial package path is given. For instance, for the path "go/types",
24 // godex prepends "golang.org/x/tools".
26 // The prefixes are computed by searching the directories specified by
27 // the GOROOT and GOPATH environment variables (and by excluding the
28 // build OS- and architecture-specific directory names from the path).
29 // The search order is depth-first and alphabetic; for a partial path
30 // "foo", a package "a/foo" is found before "b/foo".
32 // Absolute and relative paths may be provided, which disable automatic
35 // godex $GOROOT/pkg/darwin_amd64/sort
38 // All but the last path element may contain dots; a dot in the last path
39 // element separates the package path from the package object name. If the
40 // last path element contains a dot, terminate the argument with another
41 // dot (indicating an empty object name). For instance, the path for a
42 // package foo.bar would be specified as in:
49 // only consider packages from src, where src is one of the supported compilers
53 // The following sources (-s arguments) are supported:
56 // gc-generated object files
58 // gccgo-generated object files
60 // gccgo-generated object files using a condensed format (experimental)
62 // (uncompiled) source code (not yet implemented)
64 // If no -s argument is provided, godex will try to find a matching source.
66 package main // import "golang.org/x/tools/cmd/godex"
68 // BUG(gri): support for -s=source is not yet implemented
69 // BUG(gri): gccgo-importing appears to have occasional problems stalling godex; try -s=gc as work-around