FAQ
Hi all,

Just a q question. If I get some errors while compiling the go source code,
for example, cmd/go, then can I use gdb to debug it? To my understanding, I
can only use gdb after I get the 'go' executable, which means the 'Building
go package' step should has already completed. Please point out if I am
wrong.

Thanks,
Robert

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

  • Dave Cheney at Nov 20, 2013 at 3:36 am

    On Wed, Nov 20, 2013 at 2:32 PM, Robert Sandra wrote:
    Hi all,

    Just a q question. If I get some errors while compiling the go source code,
    for example, cmd/go, then can I use gdb to debug it?
    Yes, that should work.

    I'd start with

    env GO_DISTFLAGS=-v ./make.bash

    to get more details about what is happening in the early stages of the build

    To my understanding, I
    can only use gdb after I get the 'go' executable, which means the 'Building
    go package' step should has already completed. Please point out if I am
    wrong.
    I don't think that is completely true. The compilers are compiled by
    gcc and should be easily instrumented with gdb, the go executable has
    basic support for gdb debugging, but there are some sharp edges.
    Thanks,
    Robert

    --
    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.
    --
    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.
  • Robert Sandra at Nov 20, 2013 at 3:52 am
    Can you be more specific? I tried env GO_DISTFLAGS=-v ./make.bash, it
    paused at cmd/go in the step '# Building compilers and Go bootstrap tool'.
    I believe there might be a deadlock. So I am wondering how I can use gdb to
    interrupt it? Thanks.

    -robert
    On Tuesday, November 19, 2013 10:35:58 PM UTC-5, Dave Cheney wrote:

    On Wed, Nov 20, 2013 at 2:32 PM, Robert Sandra
    <robert.s...@gmail.com <javascript:>> wrote:
    Hi all,

    Just a q question. If I get some errors while compiling the go source code,
    for example, cmd/go, then can I use gdb to debug it?
    Yes, that should work.

    I'd start with

    env GO_DISTFLAGS=-v ./make.bash

    to get more details about what is happening in the early stages of the
    build

    To my understanding, I
    can only use gdb after I get the 'go' executable, which means the 'Building
    go package' step should has already completed. Please point out if I am
    wrong.
    I don't think that is completely true. The compilers are compiled by
    gcc and should be easily instrumented with gdb, the go executable has
    basic support for gdb debugging, but there are some sharp edges.
    Thanks,
    Robert

    --
    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...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
  • Dave Cheney at Nov 20, 2013 at 3:53 am
    Can you run env GO_DISTFLAGS=-v bash -x ./make.bash and paste the output

    On Wed, Nov 20, 2013 at 2:52 PM, Robert Sandra
    wrote:
    Can you be more specific? I tried env GO_DISTFLAGS=-v ./make.bash, it paused
    at cmd/go in the step '# Building compilers and Go bootstrap tool'. I
    believe there might be a deadlock. So I am wondering how I can use gdb to
    interrupt it? Thanks.

    -robert
    On Tuesday, November 19, 2013 10:35:58 PM UTC-5, Dave Cheney wrote:

    On Wed, Nov 20, 2013 at 2:32 PM, Robert Sandra
    wrote:
    Hi all,

    Just a q question. If I get some errors while compiling the go source
    code,
    for example, cmd/go, then can I use gdb to debug it?
    Yes, that should work.

    I'd start with

    env GO_DISTFLAGS=-v ./make.bash

    to get more details about what is happening in the early stages of the
    build

    To my understanding, I
    can only use gdb after I get the 'go' executable, which means the
    'Building
    go package' step should has already completed. Please point out if I am
    wrong.
    I don't think that is completely true. The compilers are compiled by
    gcc and should be easily instrumented with gdb, the go executable has
    basic support for gdb debugging, but there are some sharp edges.
    Thanks,
    Robert

    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
    --
    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.
  • Robert Sandra at Nov 20, 2013 at 4:40 am
    The following is the last a few lines of outputs. Thanks.

    pkg/go/doc
    pkg/go/build
    cmd/go
    + mv cmd/dist/dist
    /Users/q/Documents/dev/workspace/go/pkg/tool/darwin_amd64/dist
    + /Users/q/Documents/dev/workspace/go/pkg/tool/darwin_amd64/go_bootstrap
    clean -i std
    ./make.bash: line 141: 56570 Segmentation fault: 11
      "$GOTOOLDIR"/go_bootstrap clean -i std


    On Tuesday, November 19, 2013 10:53:23 PM UTC-5, Dave Cheney wrote:

    Can you run env GO_DISTFLAGS=-v bash -x ./make.bash and paste the output

    On Wed, Nov 20, 2013 at 2:52 PM, Robert Sandra
    <robert.s...@gmail.com <javascript:>> wrote:
    Can you be more specific? I tried env GO_DISTFLAGS=-v ./make.bash, it paused
    at cmd/go in the step '# Building compilers and Go bootstrap tool'. I
    believe there might be a deadlock. So I am wondering how I can use gdb to
    interrupt it? Thanks.

    -robert
    On Tuesday, November 19, 2013 10:35:58 PM UTC-5, Dave Cheney wrote:

    On Wed, Nov 20, 2013 at 2:32 PM, Robert Sandra
    wrote:
    Hi all,

    Just a q question. If I get some errors while compiling the go source
    code,
    for example, cmd/go, then can I use gdb to debug it?
    Yes, that should work.

    I'd start with

    env GO_DISTFLAGS=-v ./make.bash

    to get more details about what is happening in the early stages of the
    build

    To my understanding, I
    can only use gdb after I get the 'go' executable, which means the
    'Building
    go package' step should has already completed. Please point out if I
    am
    wrong.
    I don't think that is completely true. The compilers are compiled by
    gcc and should be easily instrumented with gdb, the go executable has
    basic support for gdb debugging, but there are some sharp edges.
    Thanks,
    Robert

    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
  • Dave Cheney at Nov 20, 2013 at 4:43 am
    While version of os x are you using ?

    On Wed, Nov 20, 2013 at 3:40 PM, Robert Sandra
    wrote:
    The following is the last a few lines of outputs. Thanks.

    pkg/go/doc
    pkg/go/build
    cmd/go
    + mv cmd/dist/dist
    /Users/q/Documents/dev/workspace/go/pkg/tool/darwin_amd64/dist
    + /Users/q/Documents/dev/workspace/go/pkg/tool/darwin_amd64/go_bootstrap
    clean -i std
    ./make.bash: line 141: 56570 Segmentation fault: 11
    "$GOTOOLDIR"/go_bootstrap clean -i std


    On Tuesday, November 19, 2013 10:53:23 PM UTC-5, Dave Cheney wrote:

    Can you run env GO_DISTFLAGS=-v bash -x ./make.bash and paste the output

    On Wed, Nov 20, 2013 at 2:52 PM, Robert Sandra
    wrote:
    Can you be more specific? I tried env GO_DISTFLAGS=-v ./make.bash, it
    paused
    at cmd/go in the step '# Building compilers and Go bootstrap tool'. I
    believe there might be a deadlock. So I am wondering how I can use gdb
    to
    interrupt it? Thanks.

    -robert
    On Tuesday, November 19, 2013 10:35:58 PM UTC-5, Dave Cheney wrote:

    On Wed, Nov 20, 2013 at 2:32 PM, Robert Sandra
    wrote:
    Hi all,

    Just a q question. If I get some errors while compiling the go source
    code,
    for example, cmd/go, then can I use gdb to debug it?
    Yes, that should work.

    I'd start with

    env GO_DISTFLAGS=-v ./make.bash

    to get more details about what is happening in the early stages of the
    build

    To my understanding, I
    can only use gdb after I get the 'go' executable, which means the
    'Building
    go package' step should has already completed. Please point out if I
    am
    wrong.
    I don't think that is completely true. The compilers are compiled by
    gcc and should be easily instrumented with gdb, the go executable has
    basic support for gdb debugging, but there are some sharp edges.
    Thanks,
    Robert

    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
    --
    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.
  • Robert Sandra at Nov 20, 2013 at 4:46 am
    10.8.5
    On Tuesday, November 19, 2013 11:43:00 PM UTC-5, Dave Cheney wrote:

    While version of os x are you using ?

    On Wed, Nov 20, 2013 at 3:40 PM, Robert Sandra
    <robert.s...@gmail.com <javascript:>> wrote:
    The following is the last a few lines of outputs. Thanks.

    pkg/go/doc
    pkg/go/build
    cmd/go
    + mv cmd/dist/dist
    /Users/q/Documents/dev/workspace/go/pkg/tool/darwin_amd64/dist
    + /Users/q/Documents/dev/workspace/go/pkg/tool/darwin_amd64/go_bootstrap
    clean -i std
    ./make.bash: line 141: 56570 Segmentation fault: 11
    "$GOTOOLDIR"/go_bootstrap clean -i std


    On Tuesday, November 19, 2013 10:53:23 PM UTC-5, Dave Cheney wrote:

    Can you run env GO_DISTFLAGS=-v bash -x ./make.bash and paste the
    output
    On Wed, Nov 20, 2013 at 2:52 PM, Robert Sandra
    wrote:
    Can you be more specific? I tried env GO_DISTFLAGS=-v ./make.bash, it
    paused
    at cmd/go in the step '# Building compilers and Go bootstrap tool'. I
    believe there might be a deadlock. So I am wondering how I can use
    gdb
    to
    interrupt it? Thanks.

    -robert
    On Tuesday, November 19, 2013 10:35:58 PM UTC-5, Dave Cheney wrote:

    On Wed, Nov 20, 2013 at 2:32 PM, Robert Sandra
    wrote:
    Hi all,

    Just a q question. If I get some errors while compiling the go
    source
    code,
    for example, cmd/go, then can I use gdb to debug it?
    Yes, that should work.

    I'd start with

    env GO_DISTFLAGS=-v ./make.bash

    to get more details about what is happening in the early stages of
    the
    build

    To my understanding, I
    can only use gdb after I get the 'go' executable, which means the
    'Building
    go package' step should has already completed. Please point out if
    I
    am
    wrong.
    I don't think that is completely true. The compilers are compiled by
    gcc and should be easily instrumented with gdb, the go executable
    has
    basic support for gdb debugging, but there are some sharp edges.
    Thanks,
    Robert

    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
  • Dave Cheney at Nov 20, 2013 at 4:53 am
    I've not seen that failure before.

    I would suggest

    1. double check that there exists only one Go installation on your
    machine and that all other GO* environment variables save GOPATH are
    unset
    2. check that your compiler is working, possibly even install Xcode 5
    which works with 1.2rcX
    3. check that you don't have another compiler installed on your
    machine masqureading as gcc or clang.
    4. If you still can't get it to compile, download the OS X installer
    or tarball from the website and try that version.

    If all of the above fails, please consider raising an issue, golang.org/issue.

    On Wed, Nov 20, 2013 at 3:46 PM, Robert Sandra
    wrote:
    10.8.5

    On Tuesday, November 19, 2013 11:43:00 PM UTC-5, Dave Cheney wrote:

    While version of os x are you using ?

    On Wed, Nov 20, 2013 at 3:40 PM, Robert Sandra
    wrote:
    The following is the last a few lines of outputs. Thanks.

    pkg/go/doc
    pkg/go/build
    cmd/go
    + mv cmd/dist/dist
    /Users/q/Documents/dev/workspace/go/pkg/tool/darwin_amd64/dist
    + /Users/q/Documents/dev/workspace/go/pkg/tool/darwin_amd64/go_bootstrap
    clean -i std
    ./make.bash: line 141: 56570 Segmentation fault: 11
    "$GOTOOLDIR"/go_bootstrap clean -i std


    On Tuesday, November 19, 2013 10:53:23 PM UTC-5, Dave Cheney wrote:

    Can you run env GO_DISTFLAGS=-v bash -x ./make.bash and paste the
    output

    On Wed, Nov 20, 2013 at 2:52 PM, Robert Sandra
    wrote:
    Can you be more specific? I tried env GO_DISTFLAGS=-v ./make.bash, it
    paused
    at cmd/go in the step '# Building compilers and Go bootstrap tool'. I
    believe there might be a deadlock. So I am wondering how I can use
    gdb
    to
    interrupt it? Thanks.

    -robert
    On Tuesday, November 19, 2013 10:35:58 PM UTC-5, Dave Cheney wrote:

    On Wed, Nov 20, 2013 at 2:32 PM, Robert Sandra
    wrote:
    Hi all,

    Just a q question. If I get some errors while compiling the go
    source
    code,
    for example, cmd/go, then can I use gdb to debug it?
    Yes, that should work.

    I'd start with

    env GO_DISTFLAGS=-v ./make.bash

    to get more details about what is happening in the early stages of
    the
    build

    To my understanding, I
    can only use gdb after I get the 'go' executable, which means the
    'Building
    go package' step should has already completed. Please point out if
    I
    am
    wrong.
    I don't think that is completely true. The compilers are compiled by
    gcc and should be easily instrumented with gdb, the go executable
    has
    basic support for gdb debugging, but there are some sharp edges.
    Thanks,
    Robert

    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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...@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
    --
    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
postedNov 20, '13 at 3:32a
activeNov 20, '13 at 4:53a
posts8
users2
websitegolang.org

2 users in discussion

Dave Cheney: 4 posts Robert Sandra: 4 posts

People

Translate

site design / logo © 2021 Grokbase