aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/debug
AgeCommit message (Collapse)Author
2014-05-20debug/plan9obj: cleanup apiDavid du Colombier
- Don't export Prog structure. - Remove ProgHeader and ExecTable structures. - Add Magic, Bss and Entry fields in FileHeader. - Replace ?_MAGIC variables with constants. - Ignore final EOF from ReadAt. - Improve documentation. Fixes #7989. LGTM=rsc R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/91400044
2014-04-29all: spelling tweaks, A-GRobert Hencke
LGTM=ruiu, bradfitz R=golang-codereviews, bradfitz, ruiu CC=golang-codereviews https://golang.org/cl/91840044
2014-04-26src: fix issues found by go vet stdRobert Hencke
LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/96850043
2014-04-16debug/pe: add optional header to FileAlex Brainman
This information is required by cmd/nm to calculate absolute symbol addresses. Update #6936 Update #7738 LGTM=rsc R=golang-codereviews, bradfitz, gobot, rsc CC=golang-codereviews https://golang.org/cl/87500043
2014-04-16liblink, cmd/ld: reenable nosplit checking and testRuss Cox
The new code is adapted from the Go 1.2 nosplit code, but it does not have the bug reported in issue 7623: g% go run nosplit.go g% go1.2 run nosplit.go BUG rejected incorrectly: main 0 call f; f 120 linker output: # _/tmp/go-test-nosplit021064539 main.main: nosplit stack overflow 120 guaranteed after split check in main.main 112 on entry to main.f -8 after main.f uses 120 g% Fixes #6931. Fixes #7623. LGTM=iant R=golang-codereviews, iant, ality CC=golang-codereviews, r https://golang.org/cl/88190043
2014-04-16all: fix typosRui Ueyama
LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/88670043
2014-04-16liblink: add leaf bit to object file formatRuss Cox
Without the leaf bit, the linker cannot record the correct frame size in the symbol table, and then stack traces get mangled. (Only for ARM.) Fixes #7338. Fixes #7347. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/88550043
2014-04-14liblink, cmd/link: add version number to object fileRuss Cox
There are changes we know we want to make, but not before Go 1.3 Add a version number so that we can make them more easily later. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/87670043
2014-03-13debug/macho: handle missing __debug_str sectionKeith Randall
debug/elf does the same thing, use []byte{} for any missing sections. Fixes #7510 LGTM=rsc R=golang-codereviews, iant CC=golang-codereviews, rsc https://golang.org/cl/75230043
2014-03-11dwarf: add extensions for multi-file compression (.dwz)Dhiru Kholia
LGTM=iant R=golang-codereviews, iant, bradfitz CC=golang-codereviews, math-nuts https://golang.org/cl/72820044
2014-02-27debug/macho: Define CPU constants for other common architectures for OS X/iOS.Robert Sesek
LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/69100045
2014-02-18cmd/ld: remove Plan 9 symbol tableRuss Cox
Update #6853 Nothing reads the Plan 9 symbol table anymore. The last holdout was 'go tool nm', but since being rewritten in Go it uses the standard symbol table for the binary format (ELF, Mach-O, PE) instead. Removing the Plan 9 symbol table saves ~15% disk space on most binaries. Two supporting changes included in this CL: debug/gosym: use Go 1.2 pclntab to synthesize func-only symbol table when there is no Plan 9 symbol table debug/elf, debug/macho, debug/pe: ignore final EOF from ReadAt LGTM=r R=r, bradfitz CC=golang-codereviews https://golang.org/cl/65740045
2014-02-15debug/elf: correct test failure printRuss Cox
LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/64380043
2014-02-13debug/macho: Add support for opening fat/universal binaries.Robert Sesek
New testdata was created from existing using: $ lipo gcc-386-darwin-exec gcc-amd64-darwin-exec -create -output fat-gcc-386-amd64-darwin-exec Fixes #7250. LGTM=dave R=golang-codereviews, dave, josharian, bradfitz CC=golang-codereviews https://golang.org/cl/60190043
2014-02-13debug/macho: add test file for CL 60190043Dave Cheney
From the description of CL 60190043 debug/macho: Add support for opening fat/universal binaries. New testdata was created from existing using: $ lipo gcc-386-darwin-exec gcc-amd64-darwin-exec -create -output fat-gcc-386-amd64-darwin-exec Update #7250 LGTM=iant R=golang-codereviews, gobot, dsymonds, iant CC=golang-codereviews https://golang.org/cl/61720044
2014-02-12debug/pe: delete unnecessary type conversionsRobert Dinu
Fixes #7104. LGTM=iant R=golang-dev, iant CC=golang-codereviews https://golang.org/cl/61480049
2014-01-27all: use {bytes,strings}.NewReader instead of bytes.BuffersBrad Fitzpatrick
Use the smaller read-only bytes.NewReader/strings.NewReader instead of a bytes.Buffer when possible. LGTM=r R=golang-codereviews, r CC=golang-codereviews https://golang.org/cl/54660045
2014-01-27debug/dwarf, debug/elf: add support for reading DWARF 4 type infoIan Lance Taylor
In DWARF 4 the debug info for large types is put into .debug_type sections, so that the linker can discard duplicate info. This change adds support for reading type units. Another small change included here is that DWARF 3 supports storing the byte offset of a struct field as a formData rather than a formDwarfBlock. R=golang-codereviews, r CC=golang-codereviews https://golang.org/cl/56300043
2014-01-22debug/plan9obj: implement parsing of Plan 9 a.out executablesDavid du Colombier
It implements parsing of the header and symbol table for both 32-bit and 64-bit Plan 9 binaries. The nm tool was updated to use this package. R=rsc, aram CC=golang-codereviews https://golang.org/cl/49970044
2014-01-08debug/goobj: add String methods for SymID and SymKindRuss Cox
R=iant CC=golang-codereviews https://golang.org/cl/48890044
2013-12-31debug/elf: add C source for testdata executablesMichael Stapelberg
This source file, when compiled with gcc 4.4.3 on Ubuntu lucid, corresponds instruction for instruction to the binaries in the same directory. Shipping this source code file resolves http://bugs.debian.org/716853 R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/46780043
2013-12-18debug/goobj: expand package prefix correctlyRuss Cox
R=r, bradfitz CC=golang-dev https://golang.org/cl/43480049
2013-12-16debug/goobj: add package for reading new Go object filesRuss Cox
R=golang-dev, r, iant CC=golang-dev https://golang.org/cl/40610043
2013-12-12debug/dwarf: remove unused field addrsize from DataIan Lance Taylor
The addrsize field is not a constant for an entire executable file, and is now handled by the dataFormat interface when reading the data. R=golang-dev, minux.ma, rsc CC=golang-dev https://golang.org/cl/41620043
2013-10-29debug/dwarf: add DWARF 4 form constantsRuss Cox
Some versions of clang generate DWARF 4-format attributes even when using -gdwarf-2. We don't care much about the values, but we do need to be able to parse past them. This fixes a bug in Go 1.2 rc2 reported via private mail using a near-tip version of clang. R=golang-dev, iant, dvyukov CC=golang-dev https://golang.org/cl/18460043
2013-10-14debug/dwarf: report the value of an unrecognized attribute formatIan Lance Taylor
R=golang-dev, r, minux.ma CC=golang-dev https://golang.org/cl/14669045
2013-10-09debug/dwarf: handle surprising clang encodingRuss Cox
Fixes a bug in cgo on OS X using clang. See golang.org/issue/6472 for details. Fixes #6472. R=golang-dev, iant CC=golang-dev https://golang.org/cl/14575043
2013-08-07runtime: convert .s textflags from numbers to symbolic constants.Keith Randall
Remove NOPROF/DUPOK from everything. Edits done with a script, except pclinetest.asm which depended on the DUPOK flag on main(). R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12613044
2013-08-05undo CL 12486043 / ab644299d124Brad Fitzpatrick
Uglier. ««« original CL description all: use strings.IndexByte instead of Index where possible R=golang-dev, khr CC=golang-dev https://golang.org/cl/12486043 »»» R=golang-dev CC=golang-dev https://golang.org/cl/12485044
2013-08-05all: use strings.IndexByte instead of Index where possibleBrad Fitzpatrick
R=golang-dev, khr CC=golang-dev https://golang.org/cl/12486043
2013-07-23all: be more idiomatic when documenting boolean return values.Rob Pike
Phrases like "returns whether or not the image is opaque" could be describing what the function does (it always returns, regardless of the opacity) or what it returns (a boolean indicating the opacity). Even when the "or not" is missing, the phrasing is bizarre. Go with "reports whether", which is still clunky but at least makes it clear we're talking about the return value. These were edited by hand. A few were cleaned up in other ways. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/11699043
2013-07-19cmd/ld, runtime: remove unused fields from FuncRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/11604043
2013-07-19debug/gosym: put pclinetest file in temporary directoryKeith Randall
where it belongs. R=rsc CC=golang-dev https://golang.org/cl/11596043
2013-07-18debug/gosym: avoid test failure on WindowsRuss Cox
Would fix build if build hadn't already been broken with something else. TBR=golang-dev CC=golang-dev https://golang.org/cl/11525043
2013-07-18debug/gosym: update for Go 1.2 pcln tableRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/11495043
2013-06-21all: avoid leaking fds during testsDave Cheney
trivial: it is not a serious problem to leak a fd in a short lived process, but it was obscuring my investigation of issue 5593. R=golang-dev, iant, bradfitz CC=golang-dev https://golang.org/cl/10391043
2013-03-22debug/elf: repair GNU version symbols.Rémy Oudompheng
After the revert of revision 9ea9e7e6e0c8 the related revision 76ff7da868c6 must be reverted too. Fixes #5102. R=golang-dev, r CC=golang-dev https://golang.org/cl/7961044
2013-03-21debug/elf: restore Go 1.0 semantics for (*File).SymbolsRuss Cox
Also adjust the implementation of applyRelocationsAMD64 so that the test added in CL 6848044 still passes. R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/7686049
2013-03-19debug/dwarf: support for DWARF 3Ian Lance Taylor
R=rsc CC=golang-dev https://golang.org/cl/7662045
2013-03-11debug/macho: add doc comment for FormatErrorRob Pike
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7624044
2013-02-26cmd/ld, runtime: adjust symbol table representationRuss Cox
This CL changes the encoding used for the Go symbol table, stored in the binary and used at run time. It does not change any of the semantics or structure: the bits are just packed a little differently. The comment at the top of runtime/symtab.c describes the new format. Compared to the Go 1.0 format, the main changes are: * Store symbol addresses as full-pointer-sized host-endian values. (For 6g, this means addresses are 64-bit little-endian.) * Store other values (frame sizes and so on) varint-encoded. The second change more than compensates for the first: for the godoc binary on OS X/amd64, the new symbol table is 8% smaller than the old symbol table (1,425,668 down from 1,546,276). This is a required step for allowing the host linker (gcc) to write the final Go binary, since it will have to fill in the symbol address slots (so the slots must be host-endian) and on 64-bit systems it may choose addresses above 4 GB. R=golang-dev, iant CC=golang-dev https://golang.org/cl/7403054
2013-02-20debug/dwarf: add flag_present attribute encoding.Robin Eklind
ref: http://www.dwarfstd.org/doc/DWARF4.pdf Update #4829 R=minux.ma, iant CC=dave, golang-dev https://golang.org/cl/7354043
2013-01-27all: make tests able to run multiple times.Rémy Oudompheng
It is now possible to run "go test -cpu=1,2,4 std" successfully. Fixes #3185. R=golang-dev, dave, minux.ma, bradfitz CC=golang-dev https://golang.org/cl/7196052
2013-01-04cmd/ld: use native-endian symbol values in symbol tableRuss Cox
The Plan 9 symbol table format defines big-endian symbol values for portability, but we want to be able to generate an ELF object file and let the host linker link it, as part of the solution to issue 4069. The symbol table itself, since it is loaded into memory at run time, must be filled in by the final host linker, using relocation directives to set the symbol values. On a little-endian machine, the linker will only fill in little-endian values during relocation, so we are forced to use little-endian symbol values. To preserve most of the original portability of the symbol table format, we make the table itself say whether it uses big- or little-endian values. If the table begins with the magic sequence fe ff ff ff 00 00 then the actual table begins after those six bytes and contains little-endian symbol values. Otherwise, the table is in the original format and contains big-endian symbol values. The magic sequence looks like an "end of table" entry (the fifth byte is zero), so legacy readers will see a little-endian table as an empty table. All the gc architectures are little-endian today, so the practical effect of this CL is to make all the generated tables little-endian, but if a big-endian system comes along, ld will not generate the magic sequence, and the various readers will fall back to the original big-endian interpretation. R=ken2 CC=golang-dev https://golang.org/cl/7066043
2012-12-18debug/elf: handle missing shstrndx in core filesDave Cheney
Fixes #4481. hello-world-core.gz was generated with a simple hello world c program and core dumped as suggested in the issue. Also: add support for gz compressed test fixtures. R=minux.ma, rsc, iant CC=golang-dev https://golang.org/cl/6936058
2012-11-15debug/elf: fix offset for GNU version symbolsJoel Sing
Since we no longer skip the first entry when reading a symbol table, we no longer need to allow for the offset difference when processing the GNU version symbols. Unbreaks builds on Linux. R=golang-dev, agl, iant CC=golang-dev https://golang.org/cl/6843057
2012-11-15debug/elf: do not skip first symbol in the symbol tableJoel Sing
Do not skip the first symbol in the symbol table. Any other indexes into the symbol table (for example, indexes in relocation entries) will now refer to the symbol following the one that was intended. Add an object that contains debug relocations, which debug/dwarf failed to decode correctly. Extend the relocation tests to cover this case. Note that the existing tests passed since the symbol following the symbol that required relocation is also of type STT_SECTION. Fixes #4107. R=golang-dev, mikioh.mikioh, iant, iant CC=golang-dev https://golang.org/cl/6848044
2012-10-09debug/pe: support PE files which contain no symbol table (if NumberOfSymbols ↵Robin Eklind
is equal to 0 in the IMAGE_FILE_HEADER structure). No longer assume that e_lfanew (in the IMAGE_DOS_HEADER strcuture) is always one byte. It is now regarded as a 4 byte uint32. Fixes #4177. R=golang-dev, alex.brainman, dave, minux.ma CC=golang-dev https://golang.org/cl/6587048
2012-09-22debug/pe: add symbol supportJoel Sing
Add support for processing the COFF symbol table. R=alex.brainman CC=golang-dev https://golang.org/cl/6551045
2012-08-03debug/elf: Add support for getting DynTag string table values.Mike Rosset
R=rsc CC=golang-dev https://golang.org/cl/6430064