{"action":"created","issue":{"url":"https://api.github.com/repos/derekparker/delve/issues/220","labels_url":"https://api.github.com/repos/derekparker/delve/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/derekparker/delve/issues/220/comments","events_url":"https://api.github.com/repos/derekparker/delve/issues/220/events","html_url":"https://github.com/derekparker/delve/issues/220","id":104898679,"number":220,"title":"Support printing nested struct member","user":{"login":"ThomasMoinel","id":2021462,"avatar_url":"https://avatars.githubusercontent.com/u/2021462?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasMoinel","html_url":"https://github.com/ThomasMoinel","followers_url":"https://api.github.com/users/ThomasMoinel/followers","following_url":"https://api.github.com/users/ThomasMoinel/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMoinel/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMoinel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMoinel/subscriptions","organizations_url":"https://api.github.com/users/ThomasMoinel/orgs","repos_url":"https://api.github.com/users/ThomasMoinel/repos","events_url":"https://api.github.com/users/ThomasMoinel/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMoinel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-04T14:13:54Z","updated_at":"2015-09-05T00:50:29Z","closed_at":null,"body":"Can't print nested struct member, see error below with example code.\r\n```\r\n% dlv debug \r\nType 'help' for list of commands.\r\n(dlv) b main.main:3\r\nBreakpoint 1 set at 0x400c37 for main.main ./nestedstruct.go:15\r\n(dlv) c\r\n> main.main() ./nestedstruct.go:15\r\n\t\r\n   10:\t}\r\n   11:\t\r\n   12:\tfunc main() {\r\n   13:\t\tb := B{A{42}}\r\n   14:\t\r\n=> 15:\t\tfmt.Println(b)\r\n   16:\t}\r\n\r\n(dlv) print b\r\nmain.B {a: main.A {val: 42}}\r\n(dlv) print b.a\r\nmain.A {val: 42}\r\n(dlv) print b.a.val\r\nCommand failed: b has no member a.val\r\n(dlv) \r\n```\r\n\r\nnestedstruct.go\r\n``` go\r\npackage main\r\n\r\nimport \"fmt\"\r\n\r\ntype A struct {\r\n\tval int\r\n}\r\ntype B struct {\r\n\ta A\r\n}\r\n\r\nfunc main() {\r\n\tb := B{A{42}}\r\n\r\n\tfmt.Println(b)\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/derekparker/delve/issues/comments/137889750","html_url":"https://github.com/derekparker/delve/issues/220#issuecomment-137889750","issue_url":"https://api.github.com/repos/derekparker/delve/issues/220","id":137889750,"user":{"login":"ThomasMoinel","id":2021462,"avatar_url":"https://avatars.githubusercontent.com/u/2021462?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasMoinel","html_url":"https://github.com/ThomasMoinel","followers_url":"https://api.github.com/users/ThomasMoinel/followers","following_url":"https://api.github.com/users/ThomasMoinel/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMoinel/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMoinel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMoinel/subscriptions","organizations_url":"https://api.github.com/users/ThomasMoinel/orgs","repos_url":"https://api.github.com/users/ThomasMoinel/repos","events_url":"https://api.github.com/users/ThomasMoinel/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMoinel/received_events","type":"User","site_admin":false},"created_at":"2015-09-05T00:50:29Z","updated_at":"2015-09-05T00:50:29Z","body":"A more complete example where every print give the same _Command failed: b has no member *_\r\n```go\r\npackage main\r\n\r\nimport \"fmt\"\r\n\r\ntype A struct {\r\n\tval int\r\n}\r\ntype B struct {\r\n\tA\r\n\ta   A\r\n\tptr *A\r\n}\r\n\r\nfunc main() {\r\n\tb := B{A: A{-314}, a: A{42}, ptr: &A{1337}}\r\n\r\n\t// print b.val\r\n\t// print b.A.val\r\n\t// print b.a.val\r\n\t// print b.ptr.val\r\n\r\n\tfmt.Println(b)\r\n}\r\n```\r\n\r\nI think a correct way is to make a recursive call in proc/variable.go evaluateStructMember.\r\nI'm trying to make it work but I struggle to learn dwarf and delve internals. If I find out a way, I'll make a pull request."}}