FAQ
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?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Ian Lance Taylor at Dec 24, 2013 at 4:01 am

    On Mon, Dec 23, 2013 at 3:26 AM, Anatoly Galiulin wrote:
    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?
    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

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Anatoly Galiulin at Dec 24, 2013 at 4:17 am
    Thanks, Ian!

    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
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 23, '13 at 11:26a
activeDec 24, '13 at 4:17a
posts3
users2
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase