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: debug info for inlined funcs are sometimes lost #26206

hyangah opened this Issue Jul 3, 2018 · 2 comments


None yet
5 participants
Copy link

hyangah commented Jul 3, 2018

with go version devel +23ce272bb1 Mon Jul 2 17:50:00 2018 +0000 linux/amd64

$ cat main.go
package main

import "fmt"

func main() {
        x := &X{Foo: 10}
        y := InlineThis(x, "bar")
        fmt.Printf("Y = %+v\n", y)

type X struct {
        Foo int

func InlineThis(x *X, s string) int {
        y := x.Foo + len(s)
        return y

With go1.11, I expected debug info for the InlineThis would be present in the (default) optimized binary,
but it doesn't.

With --gcflags="-N", I could see some trace of InlineThis in the binary.

 <1><732df>: Abbrev Number: 3 (DW_TAG_subprogram)
    <732e0>   DW_AT_name        : main.InlineThis
    <732f0>   DW_AT_inline      : 1     (inlined)
    <732f1>   DW_AT_external    : 1



This comment has been minimized.

Copy link

heschik commented Jul 3, 2018

Peculiar. Running with -d dwarfinl=2:

assembling DWARF inlined routine info for "".main
putscope("".main,0): vars:

It looks to me like the inline call table is completely missing the call to InlineThis. @thanm might be able to help.


This comment has been minimized.

Copy link

randall77 commented Jul 3, 2018

InlineThis gets inlined and completely optimized away (to a single y:=13). I'm not sure where you would hang a reference to the now-gone function.


@heschik heschik added the Debugging label Jul 10, 2018

@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Jul 11, 2018

@andybons andybons modified the milestones: Go1.12, Go1.13 Feb 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.