]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use innermost line number for -S
authorKeith Randall <keithr@alum.mit.edu>
Fri, 7 Dec 2018 18:00:36 +0000 (10:00 -0800)
committerKeith Randall <khr@golang.org>
Tue, 11 Dec 2018 20:24:45 +0000 (20:24 +0000)
commit01a1eaa10c95dbbb1decad79334a2d6f34dc6832
treed824d641a07bd20488c5c0e075309966bd6b74e3
parentec510045675ac112184052bc303be190872fd51c
cmd/compile: use innermost line number for -S

When functions are inlined, for instructions in the inlined body, does
-S print the location of the call, or the location of the body? Right
now, we do the former. I'd like to do the latter by default, it makes
much more sense when reading disassembly. With mid-stack inlining
enabled in more cases, this quandry will come up more often.

The original behavior is still available with -S=2. Some tests
use this mode (so they can find assembly generated by a particular
source line).

This helped me with understanding what the compiler was doing
while fixing #29007.

Change-Id: Id14a3a41e1b18901e7c5e460aa4caf6d940ed064
Reviewed-on: https://go-review.googlesource.com/c/153241
Reviewed-by: David Chase <drchase@google.com>
src/cmd/asm/main.go
src/cmd/compile/internal/gc/global_test.go
src/cmd/compile/internal/gc/main.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/plist.go
src/cmd/internal/obj/util.go
test/run.go