gdb and module variables

108 views
Skip to first unread message

Anatoly Galiulin

unread,
Dec 23, 2013, 6:26:12 AM12/23/13
to golan...@googlegroups.com
I am trying to debug go program, built with -gcflags "-N -l" flags. Command "print os.Args" returns "No symbol "os" in current context",
but "info variables Args" shows "struct []string os.Args;"

How can I view the contents of module variable while debugging? 

Ian Lance Taylor

unread,
Dec 23, 2013, 11:00:56 PM12/23/13
to Anatoly Galiulin, golang-nuts
gdb doesn't understand Go syntax. You need to write

print 'os.Args'

using single quotes to show that os.Args is a single name.

Ian

Anatoly Galiulin

unread,
Dec 23, 2013, 11:17:44 PM12/23/13
to golan...@googlegroups.com
Thanks, Ian!
Reply all
Reply to author
Forward
0 new messages