aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/debug
AgeCommit message (Collapse)Author
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
2014-08-31cmd/ld: diagnose Go calling CRuss Cox
For example: go build -ldflags -C cmd/go 2>&1 | awk '{print $NF}' | sort | uniq -c | sort -nr LGTM=khr R=khr, josharian CC=golang-codereviews https://golang.org/cl/135170044
2014-08-27debug/elf: support arm64 relocationsMichael Hudson-Doyle
This adds the minimal support for AArch64/arm64 relocations needed to get cgo to work (when an isomorphic patch is applied to gccgo) and a test. This change uses the "AAarch64" name for the architecture rather than the more widely accepted "arm64" because that's the name that the relevant docs from ARM such as http://infocenter.arm.com/help/topic/com.arm.doc.ihi0056b/IHI0056B_aaelf64.pdf all use. Fixes #8533. LGTM=iant R=golang-codereviews, aram, gobot, iant, minux CC=golang-codereviews https://golang.org/cl/132000043
2014-08-27cmd/{ld,link,objdump}, runtime, debug/gosym: move linker-defined symbols ↵Matthew Dempsky
into runtime package Fixes #8092. LGTM=rsc R=iant, rsc CC=golang-codereviews https://golang.org/cl/126790043
2014-08-13cmd/cgo, debug/dwarf: fix translation of zero-size arraysMatthew Dempsky
In cgo, now that recursive calls to typeConv.Type() always work, we can more robustly calculate the array sizes based on the size of our element type. Also, in debug/dwarf, the decision to call zeroType is made based on a type's usage within a particular struct, but dwarf.Type values are cached in typeCache, so the modification might affect uses of the type in other structs. Current compilers don't appear to share DWARF type entries for "[]foo" and "[0]foo", but they also don't consistently share type entries in other cases. Arguably modifying the types is an improvement in some cases, but varying translated types according to compiler whims seems like a bad idea. Lastly, also in debug/dwarf, zeroType only needs to rewrite the top-level dimension, and only if the rest of the array size is non-zero. Fixes #8428. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/127980043
2014-08-08debug/pe/testdata: make sure gcc-amd64-mingw-exec has symbolsAlex Brainman
as per rsc request LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/123970043
2014-08-06debug/dwarf: fix typos in comment for UnspecifiedTypeRob Pike
LGTM=iant, bradfitz R=bradfitz, iant CC=golang-codereviews https://golang.org/cl/120700043
2014-08-06debug/dwarf: fix Reader panic on DW_TAG_unspecified_typeDerek Parker
The linker currently produces the DWARF 3 DW_TAG_unspecified_type tag, however the Reader in debug/dwarf will panic whenever that tag is encountered. Fixes #8437. LGTM=rsc R=golang-codereviews, bradfitz, iant, rsc CC=golang-codereviews https://golang.org/cl/117280043
2014-07-16cmd/ld: use count, not upper bound, in type of arrayRob Pike
DWARF says only one is necessary. The count is preferable because it admits 0-length arrays. Update debug/dwarf to handle either form. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/111230044
2014-07-10debug/elf: add (*File).DynamicSymbols, ErrNoSymbols, and tests for ↵Pietro Gagliardi
(*File).Symbols and (*File).DynamicSymbols, and formalize symbol order. Added a complement to (*File).Symbols for the dynamic symbol table. Would be useful, for instance, if seraching for certain shared objects compatible with certain libraries (for instance, LADSPA requires an exported symbol "ladspa_descriptor"). Added a variable ErrNoSymbols that canonicalizes a return from (*File).Symbols and (*File).DyanmicSymbols if the file has no symbols. Added tests for both (*File).Symbols and (*File).DynamicSymbols; there was never a test for (*File).Symbols at all. A small C program using libelf, included in the test data, was used to produce the golden symbols to compare against. As part of the requirements for testing, (*File).Symbols and (*File).DynamicSymbols now document the order in which the symbol tables are returned (in the order the symbols appear in the file). All tests currently pass. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/107530043
2014-07-09debug/plan9obj: fix test buildAram Hăvărneanu
LGTM=0intro, dave R=dave, 0intro CC=golang-codereviews https://golang.org/cl/106560044
2014-07-09debug/plan9obj, cmd/addr2line: on Plan 9 use a.out headerAram Hăvărneanu
size instead of abusing text symbol cmd/addr2line needs to know the virtual address of the start of the text segment (load address plus header size). For this, it used the text symbol added by the linker. This is wrong on amd64. Header size is 40 bytes, not 32 like on 386 and arm. Function alignment is 16 bytes causing text to be at 0x200030. debug/plan9obj now exports both the load address and the header size; cmd/addr2line uses this new information and doesn't rely on text anymore. LGTM=0intro R=0intro, gobot, ality CC=ality, golang-codereviews, jas, mischief https://golang.org/cl/106460044
2014-07-05debug/elf: fix nil deref in testDmitriy Vyukov
LGTM=crawshaw R=golang-codereviews, crawshaw CC=golang-codereviews https://golang.org/cl/109470044
2014-06-03debug/elf: support DWARF that needs relocs for 386Ian Lance Taylor
It's not clear how widespread this issue is, but we do have a test case generated by a development version of clang. I don't know whether this should go into 1.3 or not; happy to hear arguments either way. LGTM=rsc R=golang-codereviews, bradfitz, rsc CC=golang-codereviews https://golang.org/cl/96680045
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