summaryrefslogtreecommitdiff
path: root/src/debug
Commit message (Collapse)AuthorAgeFilesLines
* debug/dwarf: heuristically handle both UNIX and Windows pathsAustin Clements2017-05-265-4/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently debug/dwarf assumes all paths in line tables will be UNIX-style paths, which obviously isn't the case for binaries built on Windows. However, we can't simply switch from the path package to the filepath package because we don't know that we're running on the same host type that built the binary and we want this to work even if we're not. This is essentially the approach taken by GDB, which treats paths in accordance with the system GDB itself is compiled for. In fact, we can't even guess the compilation system from the type of the binary because it may have been cross-compiled. We fix this by heuristically determining whether paths are UNIX-style or DOS-style by looking for a drive letter or UNC path. If we see a DOS-style path, we use appropriate logic for determining whether the path is absolute and for joining two paths. This is helped by the fact that we should basically always be starting with an absolute path. However, it could mistake a relative UNIX-style path that begins with a directory like "C:" for an absolute DOS-style path. There doesn't seem to be any way around this. Fixes #19784. Change-Id: Ie13b546d2f1dcd8b02e668583a627b571b281588 Reviewed-on: https://go-review.googlesource.com/44017 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* cmd/link: actually generate .debug_gdb_scripts section on windowsAlex Brainman2017-05-151-0/+10
| | | | | | | | | | | | | | | | | | | | | Adjust finddebugruntimepath to look for runtime/debug.go file instead of runtime/runtime.go. This actually finds runtime.GOMAXPROCS in every Go executable (including windows). I also included "-Wl,-T,fix_debug_gdb_scripts.ld" parameter to gcc invocation on windows to work around gcc bug (see #20183 for details). This CL only fixes windows -buildmode=exe, buildmode=c-archive is still broken. Thanks to Egon Elbre and Nick Clifton for investigation. Fixes #20183 Fixes #20218 Change-Id: I5369a4db3913226aef3d9bd6317446856b0a1c34 Reviewed-on: https://go-review.googlesource.com/43331 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/internal/obj: fix LSym.Type during compilation, not linkingJosh Bleecher Snyder2017-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this CL, the compiler and assembler were sloppy about the LSym.Type for LSyms containing static data. The linker then fixed this up, converting Sxxx and SBSS to SDATA, and SNOPTRBSS to SNOPTRDATA if it noticed that the symbol had associated data. It is preferable to just get this right in cmd/compile and cmd/asm, because it removes an unnecessary traversal of the symbol table from the linker (see #14624). Do this by touching up the LSym.Type fixes in LSym.prepwrite and Link.Globl. I have confirmed by instrumenting the linker that the now-eliminated code paths were unreached. And an additional check in the object file writing code will help preserve that invariant. There was a case in the Windows linker, with internal linking and cgo, where we were generating SNOPTRBSS symbols with data. For now, convert those at the site at which they occur into SNOPTRDATA, just like they were. Does not pass toolstash-check, but does generate identical linked binaries. No compiler performance changes. Change-Id: I77b071ab103685ff8e042cee9abb864385488872 Reviewed-on: https://go-review.googlesource.com/40864 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
* debug/pe: add TestBuildingWindowsGUIAlex Brainman2017-03-301-0/+46
| | | | | | Change-Id: I6b6a6dc57e48e02ff0d452755b8dcf5543b3caed Reviewed-on: https://go-review.googlesource.com/38759 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/link: write dwarf sectionsAlex Brainman2017-03-011-2/+0
| | | | | | | | | | | Also stop skipping TestExternalLinkerDWARF and TestDefaultLinkerDWARF. Fixes #10776. Change-Id: Ia596a684132e3cdee59ce5539293eedc1752fe5a Reviewed-on: https://go-review.googlesource.com/36983 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* debug/pe: add test to check dwarf infoAlex Brainman2017-02-162-12/+106
| | | | | | | | | | For #10776. Change-Id: I7931558257c1f6b895e4d44b46d320a54de0d677 Reviewed-on: https://go-review.googlesource.com/36973 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/objdump: copy gosym.PCValue into internal packageKeith Randall2016-12-011-7/+0
| | | | | | | | | | ... so we don't have to export gosym.PCValue. Change-Id: Ie8f196d5e5ab63e3e69d1d7b4bfbbf32b7b5e4f5 Reviewed-on: https://go-review.googlesource.com/33791 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: do not create symbol table if FileHeader.PointerToSymbolTable is 0Alex Brainman2016-11-171-0/+3
| | | | | | | | | | | | | | | | | https://github.com/tpn/pdfs/raw/master/Microsoft Portable Executable and Common Object File Format Specification - 1999 (pecoff).doc says this about PointerToSymbolTable: File offset of the COFF symbol table or 0 if none is present. Do as it says. Fixes #17809. Change-Id: Ib1ad83532f36a3e56c7e058dc9b2acfbf60c4e72 Reviewed-on: https://go-review.googlesource.com/33170 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/elf: SPARC64 relocation type is only 8 bitsIan Lance Taylor2016-11-101-1/+1
| | | | | | | | | | | | | | | | | | https://docs.oracle.com/cd/E53394_01/html/E54813/chapter6-54839.html#OSLLGchapter6-24: "For 64–bit SPARC Elf64_Rela structures, the r_info field is further broken down into an 8–bit type identifier and a 24–bit type dependent data field. For the existing relocation types, the data field is zero. New relocation types, however, might make use of the data bits. #define ELF64_R_TYPE_ID(info) (((Elf64_Xword)(info)<<56)>>56) " No test for this because the only test would be an invalid object file. Change-Id: I5052ca3bfaf0759e920f9a24a16fd97543b24486 Reviewed-on: https://go-review.googlesource.com/33091 Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
* all: make copyright headers consistent with one space after periodMichael Munday2016-11-041-1/+1
| | | | | | | | Continuation of CL 20111. Change-Id: Ie2f62237e6ec316989c021de9b267cc9d6ee6676 Reviewed-on: https://go-review.googlesource.com/32830 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* debug/elf: add support for GOARCH=mips{,le}Vladimir Stefanovic2016-11-034-1/+79
| | | | | | | Change-Id: Ia6f8ae7e56a49ad66b60a24c4afb606f3cfe5efd Reviewed-on: https://go-review.googlesource.com/31482 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* cmd/dist: use debug/pe directly for cmd/linkRuss Cox2016-10-174-5/+8
| | | | | | | | Delete vendored copy. Change-Id: I06e9d3b709553a1a8d06275e99bd8f617aac5788 Reviewed-on: https://go-review.googlesource.com/31011 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* debug/elf: add sparc64 relocationsJames Clarke2016-10-113-0/+66
| | | | | | Change-Id: I1a2504ad9ca8607588d2d366598115fe360435b5 Reviewed-on: https://go-review.googlesource.com/30870 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* all: use testing.GoToolPath instead of "go"Keith Randall2016-08-302-3/+3
| | | | | | | | | | | | | | This change makes sure that tests are run with the correct version of the go tool. The correct version is the one that we invoked with "go test", not the one that is first in our path. Fixes #16577 Change-Id: If22c8f8c3ec9e7c35d094362873819f2fbb8559b Reviewed-on: https://go-review.googlesource.com/28089 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/objdump: implement objdump of .o filesKeith Randall2016-08-241-3/+7
| | | | | | | | | | | | | | | | | | | 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>
* debug/macho: fix comment on Section64Michael Matloob2016-08-231-1/+1
| | | | | | Change-Id: I7c809ec385b56ebb2ec784a1479d466df6ab4d1a Reviewed-on: https://go-review.googlesource.com/27565 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* debug/pe: revert CL 22720Alex Brainman2016-08-184-22/+22
| | | | | | | | | | | | | CL 22720 hid all recently added functionality for go1.7. Make everything exported again, so we could use it now. Updates #15345 Change-Id: Id8ccba7199422b554407ec14c343d2c28fbb8f72 Reviewed-on: https://go-review.googlesource.com/27212 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
* debug/pe: handle files with no string tableAlex Brainman2016-06-193-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | pecoff.doc (https://goo.gl/ayvckk) in section 5.6 says: Immediately following the COFF symbol table is the COFF string table. The position of this table is found by taking the symbol table address in the COFF header, and adding the number of symbols multiplied by the size of a symbol. So it is unclear what to do when symbol table address is 0. Lets assume executable does not have any string table. Added new test with executable with no symbol table. The gcc -s testdata\hello.c -o testdata\gcc-386-mingw-no-symbols-exec. command was used to generate the executable. Fixes #16084 Change-Id: Ie74137ac64b15daadd28e1f0315f3b62d1bf2059 Reviewed-on: https://go-review.googlesource.com/24200 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/gosym: parse remote packages correctlyAlessandro Arzilli2016-05-172-5/+57
| | | | | | | | | | Fixes #15675 Change-Id: I8bad220988e5d690f20804db970b2db037c81187 Reviewed-on: https://go-review.googlesource.com/23086 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/compile: add -linkobj flag to allow writing object file in two partsRuss Cox2016-05-091-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flag is experimental and the semantics may change even after Go 1.7 is released. There are no changes to code not using the flag. The first part is for reading by future compiles. The second part is for reading by the final link step. Splitting the file this way allows distributed build systems to ship the compile-input part only to compile steps and the linker-input part only to linker steps. The first part is basically just the export data, and the second part is basically everything else. The overall files still have the same broad structure, so that existing tools will work with both halves. It's just that various pieces are empty in the two halves. This also copies the two bits of data the linker needed from export data into the object header proper, so that the linker doesn't need any export data at all. That eliminates a TODO that was left for switching to the binary export data. (Now the linker doesn't need to know about the switch.) The default is still to write out a combined output file. Nothing changes unless you pass -linkobj to the compiler. There is no support in the go command for -linkobj, since the go command doesn't copy objects around. The expectation is that other build systems (like bazel, say) might take advantage of this. The header adjustment and the option for the split output was intended as part of the zip archives, but the zip archives have been cut from Go 1.7. Doing this to the current archives both unblocks one step in the switch to binary export data and enables alternate build systems to experiment with the new flag using the Go 1.7 release. Change-Id: I8b6eab25b8a22b0a266ba0ac6d31e594f3d117f3 Reviewed-on: https://go-review.googlesource.com/22500 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
* all: use SeekStart, SeekCurrent, SeekEndJoe Tsai2016-05-062-7/+7
| | | | | | | | | | | | | | CL/19862 (f79b50b8d5bc159561c1dcf7c17e2a0db96a9a11) recently introduced the constants SeekStart, SeekCurrent, and SeekEnd to the io package. We should use these constants consistently throughout the code base. Updates #15269 Change-Id: If7fcaca7676e4a51f588528f5ced28220d9639a2 Reviewed-on: https://go-review.googlesource.com/22097 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Joe Tsai <joetsai@digital-static.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: unexport newly introduced identifiersAlex Brainman2016-05-054-22/+22
| | | | | | | | | | | | | | | | | | | | | | CLs 22181, 22332 and 22336 intorduced new functionality to be used in cmd/link (see issue #15345 for details). But we didn't have chance to use new functionality yet. Unexport newly introduced identifiers, so we don't have to commit to the API until we actually tried it. Rename File.COFFSymbols into File._COFFSymbols, COFFSymbol.FullName into COFFSymbol._FullName, Section.Relocs into Section._Relocs, Reloc into _Relocs, File.StringTable into File._StringTable and StringTable into _StringTable. Updates #15345 Change-Id: I770eeb61f855de85e0c175225d5d1c006869b9ec Reviewed-on: https://go-review.googlesource.com/22720 Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: make copyright headers consistent with one space after periodEmmanuel Odeke2016-05-021-1/+1
| | | | | | | | | | | | | | | | | | Follows suit with https://go-review.googlesource.com/#/c/20111. Generated by running $ grep -R 'Go Authors. All' * | cut -d":" -f1 | while read F;do perl -pi -e 's/Go Authors. All/Go Authors. All/g' $F;done The code in cmd/internal/unvendor wasn't changed. Fixes #15213 Change-Id: I4f235cee0a62ec435f9e8540a1ec08ae03b1a75f Reviewed-on: https://go-review.googlesource.com/21819 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: .bss section must contain only zerosAlex Brainman2016-04-292-1/+89
| | | | | | | | | | | | | | | .bss section has no data stored in PE file. But when .bss section data is used by the linker it is assumed that its every byte is set to zero. (*Section).Data returns garbage at this moment. Change (*Section).Data so it returns slice filled with 0s. Updates #15345 Change-Id: I1fa5138244a9447e1d59dec24178b1dd0fd4c5d7 Reviewed-on: https://go-review.googlesource.com/22544 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: better error messagesAlex Brainman2016-04-251-4/+7
| | | | | | | | | | Updates #15345 Change-Id: Iae35d3e378cbc8157ba1ff91e4971ed4515a5e5c Reviewed-on: https://go-review.googlesource.com/22394 Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: introduce File.COFFSymbols and (*COFFSymbol).FullNameAlex Brainman2016-04-243-43/+83
| | | | | | | | | | | | | | | | | | | | | Reloc.SymbolTableIndex is an index into symbol table. But Reloc.SymbolTableIndex cannot be used as index into File.Symbols, because File.Symbols slice has Aux lines removed as it is built. We cannot change the way File.Symbols works, so I propose we introduce new File.COFFSymbols that does not have that limitation. Also unlike File.Symbols, File.COFFSymbols will consist of COFFSymbol. COFFSymbol matches PE COFF specification exactly, and it is simpler to use. Updates #15345 Change-Id: Icbc265853a472529cd6d64a76427b27e5459e373 Reviewed-on: https://go-review.googlesource.com/22336 Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: introduce Section.RelocsAlex Brainman2016-04-212-0/+35
| | | | | | | | | | | | | cmd/link reads PE object files when building programs with cgo. cmd/link accesses object relocations. Add new Section.Relocs that provides similar functionality in debug/pe. Updates #15345 Change-Id: I34de91b7f18cf1c9e4cdb3aedd685486a625ac92 Reviewed-on: https://go-review.googlesource.com/22332 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* debug/pe: update cstring documentationAlex Brainman2016-04-211-3/+2
| | | | | | | | | | Updates #15345 Change-Id: If1fca1f6042571cb0ac689bbb3c294309dd6e7b4 Reviewed-on: https://go-review.googlesource.com/22331 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: pretty section.go codeAlex Brainman2016-04-212-10/+27
| | | | | | | | | | | | Introduce (*SectionHeader32).fullName and add documentation comments. Updates #15345 Change-Id: I8f3b8ab9492642d62e7aad010c91c68daea3f14b Reviewed-on: https://go-review.googlesource.com/22301 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: move some code into section.go and symbol.goAlex Brainman2016-04-204-71/+85
| | | | | | | | | | | | Just moving code. No code changes. Updates #15345 Change-Id: I89c257b7aae4fbd78ce59a42909ecb3ff493659d Reviewed-on: https://go-review.googlesource.com/22300 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/pe: introduce StringTable typeAlex Brainman2016-04-202-7/+73
| | | | | | | | | | | | | | PE specification requires that long section and symbol names are stored in PE string table. Introduce StringTable that implements this functionality. Only string table reading is implemented. Updates #15345 Change-Id: Ib9638617f2ab1881ad707111d96fc68b0e47340e Reviewed-on: https://go-review.googlesource.com/22181 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* debug/pe: add some documentation and TODOAlex Brainman2016-04-201-25/+27
| | | | | | | | | | | | | No code changes. Just moved ImportDirectory next to ImportedSymbols. And moved useless FormatError to the bottom of file.go. Updates #15345 Change-Id: I91ff243cefd18008b1c5ee9ec4326583deee431b Reviewed-on: https://go-review.googlesource.com/22182 Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: remove unnecessary type conversionsMatthew Dempsky2016-04-157-26/+26
| | | | | | | | | | | | | cmd and runtime were handled separately, and I'm intentionally skipped syscall. This is the rest of the standard library. CL generated mechanically with github.com/mdempsky/unconvert. Change-Id: I9e0eff886974dedc37adb93f602064b83e469122 Reviewed-on: https://go-review.googlesource.com/22104 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: use new io.SeekFoo constants instead of os.SEEK_FOOBrad Fitzpatrick2016-04-132-8/+8
| | | | | | | | | | | | Automated change. Fixes #15269 Change-Id: I8deb2ac0101d3f7c390467ceb0a1561b72edbb2f Reviewed-on: https://go-review.googlesource.com/21962 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/gosym: accept PC quantum of 2 (for s390x)Michael Munday2016-04-121-1/+1
| | | | | | | | | Needed for the header check to accept the header generated for s390x as Go 1.2 style rather than Go 1.1 style. Change-Id: I7b3713d4cc7514cfc58f947a45702348f6d7b824 Reviewed-on: https://go-review.googlesource.com/20966 Reviewed-by: Minux Ma <minux@golang.org>
* debug/gosym: do not forget to close test binay file handle in TestPCLineAlex Brainman2016-04-051-0/+1
| | | | | | | | | | Fixes #15121 Change-Id: I651521743c56244c55eda5762905889d7e06887a Reviewed-on: https://go-review.googlesource.com/21521 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: fix spelling mistakesEric Engestrom2016-04-031-1/+1
| | | | | | | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Change-Id: I91873aaebf79bdf1c00d38aacc1a1fb8d79656a7 Reviewed-on: https://go-review.googlesource.com/21433 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/elf: deflake file_test.goJoe Tsai2016-03-301-1/+1
| | | | | | | | | | | | It is valid for io.Reader to return (n, io.EOF) where n is positive. The unit test should not fail if io.EOF is returned when read until the end. Change-Id: I7b918e3cc03db8b90c8aa58f4c0f7806a1d4af7e Reviewed-on: https://go-review.googlesource.com/21307 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/elf: add s390x relocationsMichael Munday2016-03-294-0/+204
| | | | | | Change-Id: I8440f69c7f99d65b2f69035c26b4a62104f22bd3 Reviewed-on: https://go-review.googlesource.com/20874 Reviewed-by: Minux Ma <minux@golang.org>
* all: delete dead non-test codeDominik Honnef2016-03-251-23/+0
| | | | | | | | | | | | | | | | | | | | | | | This change removes a lot of dead code. Some of the code has never been used, not even when it was first commited. The rest shouldn't have survived refactors. This change doesn't remove unused routines helpful for debugging, nor does it remove code that's used in commented out blocks of code that are only unused temporarily. Furthermore, unused constants weren't removed when they were part of a set of constants from specifications. One noteworthy omission from this CL are about 1000 lines of unused code in cmd/fix, 700 lines of which are the typechecker, which hasn't been used ever since the pre-Go 1 fixes have been removed. I wasn't sure if this code should stick around for future uses of cmd/fix or be culled as well. Change-Id: Ib714bc7e487edc11ad23ba1c3222d1fd02e4a549 Reviewed-on: https://go-review.googlesource.com/20926 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: zero mtimes in testdata gz filesCaleb Spare2016-03-251-0/+0
| | | | | | | | | | Fixes #14937. Change-Id: Iea11a32230d44d5a43f8aec812d25f13bce85895 Reviewed-on: https://go-review.googlesource.com/21038 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/dwarf: add Reader.SeekPC and Data.RangesIan Lance Taylor2016-03-227-8/+254
| | | | | | | | | | | | | | | | These new methods help find the compilation unit to pass to the LineReader method in order to find the line information for a PC. The Ranges method also helps identify the specific function for a PC, needed to determine the function name. This uses the .debug.ranges section if necessary, and changes the object file format packages to pass in the section contents if available. Change-Id: I5ebc3d27faaf1a126ffb17a1e6027efdf64af836 Reviewed-on: https://go-review.googlesource.com/20769 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: delete dead test codeDominik Honnef2016-03-211-2/+0
| | | | | | | | | | This deletes unused code and helpers from tests. Change-Id: Ie31d46115f558ceb8da6efbf90c3c204e03b0d7e Reviewed-on: https://go-review.googlesource.com/20927 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* Rewrite leftover references to plan9.bell-labs.com to 9p.io.Muhammed Uluyol2016-03-061-1/+1
| | | | | | Change-Id: Iadb4aa016a7b361d01827787dbc59164d5d147f2 Reviewed-on: https://go-review.googlesource.com/20291 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: single space after period.Brad Fitzpatrick2016-03-029-21/+21
| | | | | | | | | | | | | | | | | | | | The tree's pretty inconsistent about single space vs double space after a period in documentation. Make it consistently a single space, per earlier decisions. This means contributors won't be confused by misleading precedence. This CL doesn't use go/doc to parse. It only addresses // comments. It was generated with: $ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])') $ go test go/doc -update Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7 Reviewed-on: https://go-review.googlesource.com/20022 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Dave Day <djd@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: make copyright headers consistent with one space after periodBrad Fitzpatrick2016-03-0128-28/+28
| | | | | | | | | | | | | | | | | | | | | | This is a subset of https://golang.org/cl/20022 with only the copyright header lines, so the next CL will be smaller and more reviewable. Go policy has been single space after periods in comments for some time. The copyright header template at: https://golang.org/doc/contribute.html#copyright also uses a single space. Make them all consistent. Change-Id: Icc26c6b8495c3820da6b171ca96a74701b4a01b0 Reviewed-on: https://go-review.googlesource.com/20111 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: remove public named return values when uselessBrad Fitzpatrick2016-02-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Named returned values should only be used on public funcs and methods when it contributes to the documentation. Named return values should not be used if they're only saving the programmer a few lines of code inside the body of the function, especially if that means there's stutter in the documentation or it was only there so the programmer could use a naked return statement. (Naked returns should not be used except in very small functions) This change is a manual audit & cleanup of public func signatures. Signatures were not changed if: * the func was private (wouldn't be in public godoc) * the documentation referenced it * the named return value was an interesting name. (i.e. it wasn't simply stutter, repeating the name of the type) There should be no changes in behavior. (At least: none intended) Change-Id: I3472ef49619678fe786e5e0994bdf2d9de76d109 Reviewed-on: https://go-review.googlesource.com/20024 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
* debug/gosym: fix TestPCLine on Plan 9David du Colombier2016-02-271-1/+1
| | | | | | | | | | | | | | | Plan 9 doesn't define main, so the INITENTRY symbol remains with the SXREF type, which leads Entryvalue to fail on "entry not text: main". Fixes #14536. Change-Id: Id9b7d61e5c2202aba3ec9cd52f5b56e0a38f7c47 Reviewed-on: https://go-review.googlesource.com/19973 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* all: fix typos and spellingMartin Möhrmann2016-02-241-1/+1
| | | | | | | | Change-Id: Icd06d99c42b8299fd931c7da821e1f418684d913 Reviewed-on: https://go-review.googlesource.com/19829 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* debug/dwarf: fix nil pointer dereference in cyclic type structuresAustin Clements2016-01-145-8/+69
| | | | | | | | | | | | | | | | | | | | | Currently readType simultaneously constructs a type graph and resolves the sizes of the types. However, these two operations are fundamentally at odds: the order we parse a cyclic structure in may be different than the order we need to resolve type sizes in. As a result, it's possible that when readType attempts to resolve the size of a typedef, it may dereference a nil Type field of another typedef retrieved from the type cache that's only partially constructed. To fix this, we delay resolving typedef sizes until the end of the readType recursion, when the full type graph is constructed. Fixes #13039. Change-Id: I9889af37fb3be5437995030fdd61e45871319d07 Reviewed-on: https://go-review.googlesource.com/18459 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>