diff options
author | Keith Randall <khr@golang.org> | 2016-07-02 17:19:25 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2016-08-24 17:36:59 +0000 |
commit | a99f812cba4c5a5207fed9be5488312a44a5df34 (patch) | |
tree | d529f4e86495db40844a6640477deefea4f7c349 /src/cmd/pprof | |
parent | 873dca4c17437d07ae97ef4f9e9a8e8c93d88bd7 (diff) | |
download | go-a99f812cba4c5a5207fed9be5488312a44a5df34.tar.gz go-a99f812cba4c5a5207fed9be5488312a44a5df34.zip |
cmd/objdump: implement objdump of .o files
Update goobj reader so it can provide all the information
necessary to disassemble .o (and .a) files.
Grab architecture of .o files from header.
.o files have relocations in them. This CL also contains a simple
mechanism to disassemble relocations and add relocation info as an extra
column in the output.
Fixes #13862
Change-Id: I608fd253ff1522ea47f18be650b38d528dae9054
Reviewed-on: https://go-review.googlesource.com/24818
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/pprof')
-rw-r--r-- | src/cmd/pprof/pprof.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cmd/pprof/pprof.go b/src/cmd/pprof/pprof.go index 5ee8a112e0..0c979b1831 100644 --- a/src/cmd/pprof/pprof.go +++ b/src/cmd/pprof/pprof.go @@ -6,7 +6,6 @@ package main import ( "debug/dwarf" - "debug/gosym" "flag" "fmt" "net/url" @@ -161,7 +160,7 @@ func (t *objTool) Disasm(file string, start, end uint64) ([]plugin.Inst, error) return nil, err } var asm []plugin.Inst - d.Decode(start, end, func(pc, size uint64, file string, line int, text string) { + d.Decode(start, end, nil, func(pc, size uint64, file string, line int, text string) { asm = append(asm, plugin.Inst{Addr: pc, File: file, Line: line, Text: text}) }) return asm, nil @@ -203,7 +202,7 @@ type file struct { offset uint64 sym []objfile.Sym file *objfile.File - pcln *gosym.Table + pcln objfile.Liner triedDwarf bool dwarf *dwarf.Data |