FAQ
Hi Everyone,

We're working on a pretty complex backend in Go running on App Engine.
Exploring the gdb debugging options, we can't get gdb to print variables.
Here's what we do:

ps | grep _go_app
...
sudo gdb attach 1734 -d $GOPATH/projectfolder
...

*(gdb) i var Active*
All variables matching regular expression "Active":

File _go_main.go:
<data variable, no debug info> myapp.getUsersActive·f;
struct []string myapp/config.ActiveForUids;
*(gdb) p config.ActiveForUids*
No symbol "config" in current context.
(gdb)

Any idea, why the p command fails?

--
--
rottmann.net | Google+ <https://plus.google.com/106658337982640166595> |
Twitter <http://twitter.com/ralf> | Facebook<http://www.facebook.com/ralfrottmann>|
LinkedIn <http://de.linkedin.com/in/rottmann>

--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ian Lance Taylor at Apr 29, 2014 at 11:38 pm

    On Tue, Apr 29, 2014 at 7:03 PM, Ralf Rottmann wrote:
    We're working on a pretty complex backend in Go running on App Engine.
    Exploring the gdb debugging options, we can't get gdb to print variables.
    Here's what we do:

    ps | grep _go_app
    ...
    sudo gdb attach 1734 -d $GOPATH/projectfolder
    ...

    (gdb) i var Active
    All variables matching regular expression "Active":

    File _go_main.go:
    <data variable, no debug info> myapp.getUsersActive·f;
    struct []string myapp/config.ActiveForUids;
    (gdb) p config.ActiveForUids
    No symbol "config" in current context.
    (gdb)

    Any idea, why the p command fails?
    I don't know if this is the only issue, but I know that you need to
    use single quotes:

    p 'config.ActiveForUids'

    Otherwise gdb thinks you are referring to a field in a struct named
    config.

    See http://golang.org/doc/gdb .

    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 [email protected].
    For more options, visit https://groups.google.com/d/optout.
  • Ralf Rottmann at Apr 29, 2014 at 11:49 pm
    Thanks, Ian!

    I had to

    p 'myapp/config.ActiveForUids'

    On Wednesday, April 30, 2014 1:38:06 AM UTC+2, Ian Lance Taylor wrote:
    On Tue, Apr 29, 2014 at 7:03 PM, Ralf Rottmann wrote:

    We're working on a pretty complex backend in Go running on App Engine.
    Exploring the gdb debugging options, we can't get gdb to print
    variables.
    Here's what we do:

    ps | grep _go_app
    ...
    sudo gdb attach 1734 -d $GOPATH/projectfolder
    ...

    (gdb) i var Active
    All variables matching regular expression "Active":

    File _go_main.go:
    <data variable, no debug info> myapp.getUsersActive·f;
    struct []string myapp/config.ActiveForUids;
    (gdb) p config.ActiveForUids
    No symbol "config" in current context.
    (gdb)

    Any idea, why the p command fails?
    I don't know if this is the only issue, but I know that you need to
    use single quotes:

    p 'config.ActiveForUids'

    Otherwise gdb thinks you are referring to a field in a struct named
    config.

    See http://golang.org/doc/gdb .

    Ian
    --
    --
    rottmann.net | Google+ <https://plus.google.com/106658337982640166595> |
    Twitter <http://twitter.com/ralf> | Facebook<http://www.facebook.com/ralfrottmann>|
    LinkedIn <http://de.linkedin.com/in/rottmann>

    --
    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 [email protected].
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 29, '14 at 11:03p
activeApr 29, '14 at 11:49p
posts3
users2
websitegolang.org

2 users in discussion

Ralf Rottmann: 2 posts Ian Lance Taylor: 1 post

People

Translate

site design / logo © 2023 Grokbase