Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: autotmp_ variables included in DWARF #17644

Closed
aarzilli opened this issue Oct 28, 2016 · 4 comments
Closed

cmd/compile: autotmp_ variables included in DWARF #17644

aarzilli opened this issue Oct 28, 2016 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@aarzilli
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +f595848 Fri Oct 28 04:36:31 2016 +0000 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/a/n/go/"
GORACE=""
GOROOT="/usr/local/go-tip"
GOTOOLDIR="/usr/local/go-tip/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build802960213=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

Complied this with gcflags='-N -l' then ran objdump --dwarf on the output.

What did you expect to see?

No autotmp_nn variables in .debug_info.

What did you see instead?

 <1><1901a>: Abbrev Number: 2 (DW_TAG_subprogram)
    <1901b>   DW_AT_name        : main.main
    <19025>   DW_AT_low_pc      : 0x44a4e0
    <1902d>   DW_AT_high_pc     : 0x44a550
    <19035>   DW_AT_external    : 1
 <2><19036>: Abbrev Number: 4 (DW_TAG_variable)
    <19037>   DW_AT_name        : i
    <19039>   DW_AT_location    : 4 byte block: 9c 11 50 22     (DW_OP_call_frame_cfa; DW_OP_consts: -48; DW_OP_plus)
    <1903e>   DW_AT_type        : <0x1b07e>
 <2><19046>: Abbrev Number: 4 (DW_TAG_variable)
    <19047>   DW_AT_name        : i#1
    <1904b>   DW_AT_location    : 4 byte block: 9c 11 58 22     (DW_OP_call_frame_cfa; DW_OP_consts: -40; DW_OP_plus)
    <19050>   DW_AT_type        : <0x1b07e>
 <2><19058>: Abbrev Number: 4 (DW_TAG_variable)
    <19059>   DW_AT_name        : autotmp_1
    <19063>   DW_AT_location    : 4 byte block: 9c 11 60 22     (DW_OP_call_frame_cfa; DW_OP_consts: -32; DW_OP_plus)
    <19068>   DW_AT_type        : <0x1b07e>
 <2><19070>: Abbrev Number: 4 (DW_TAG_variable)
    <19071>   DW_AT_name        : autotmp_0
    <1907b>   DW_AT_location    : 4 byte block: 9c 11 68 22     (DW_OP_call_frame_cfa; DW_OP_consts: -24; DW_OP_plus)
    <19080>   DW_AT_type        : <0x1b07e>
 <2><19088>: Abbrev Number: 0

This bug was introduced by commit d80e8de see also #17240

@gopherbot
Copy link

CL https://golang.org/cl/32159 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/32255 mentions this issue.

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 28, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Oct 28, 2016
@gopherbot
Copy link

CL https://golang.org/cl/32419 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/33233 mentions this issue.

gopherbot pushed a commit that referenced this issue Nov 16, 2016
Autotmp filtering was too aggressive and excluded types
necessary to make debuggers work properly.  Restore the
"late filter" in dwarf.go based on names to exclude autotmps,
and remove the "early filter" in pgen.go based on how the
name was introduced.  However, the updated naming scheme
with a dot prefix is retained to prevent accidental clashes
with legal Go identifier names.

Includes test (grouped with runtime gdb tests),
verified to fail without the fix.

Updates #17644.
Fixes #17830.

Change-Id: I7ec3f7230083889660236e5f6bc77ba5fe434e93
Reviewed-on: https://go-review.googlesource.com/33233
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
@golang golang locked and limited conversation to collaborators Nov 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants