GoClipse / goclipse

Eclipse IDE for the Go programming language:
http://goclipse.github.io/
Eclipse Public License 1.0
841 stars 286 forks source link

CDT Based Debugger Produces GDB Errors During Debugging Sessions #41

Closed sesteel closed 9 years ago

sesteel commented 10 years ago

Platform: Linux (Ubuntu 13.10) Arch: amd64 Go: go version devel +e5646e0df5a5 Thu Feb 13 19:59:09 2014 -0500 linux/amd64

When debugging, the CDT/GDB based debugger sometimes fails to perform certain commands. For example, the following code:

    // NewRGBA returns a new RGBA with the given bounds.
    func NewRGBA(r Rectangle) *RGBA {
        w, h := r.Dx(), r.Dy()
        buf := make([]uint8, 4*w*h)
        return &RGBA{buf, 4 * w, r}
    }

creates this debugger error:

~anon1  Error: Multiple errors reported.\ Failed to execute MI command: -var-create - * ~anon1 Error message from debugger back end: -var-create: unable to create variable object\ Failed to execute MI command: -var-create - * ~anon1 Error message from debugger back end: -var-create: unable to create variable object\ Failed to execute MI command: -data-evaluate-expression ~anon1 Error message from debugger back end: A syntax error in expression, near `~anon1'.\ Failed to execute MI command: -var-create - * ~anon1 Error message from debugger back end: -var-create: unable to create variable object\ Unable to create variable object 
bruno-medeiros commented 10 years ago

This issue seems to be caused when the Go debug info in the executable has variables with odd names, such as ~anon1. I even got a variable named r·2 when running this. I think this is indicative primarily of a Go bug, since variables should not have these invalid names. GDB in the command line also is unable to handle them. (for example print ~anon1 will fail)

sesteel commented 9 years ago

If memory serves, the gopath is created dynamically and differently based on the operation being performed. In the case of a 'go get'; it is $GOPATH while for 'go build' it is $PROJECT:$GOPATH. So, I think all 'go get's go to GOPATH and the only way to change that is to modify code.

On Thu, Sep 25, 2014 at 11:10 AM, Bruno Medeiros notifications@github.com wrote:

Closed #41 https://github.com/GoClipse/goclipse/issues/41.

— Reply to this email directly or view it on GitHub https://github.com/GoClipse/goclipse/issues/41#event-170287642.

bruno-medeiros commented 9 years ago

@sesteel was that meant to be an answer to https://github.com/GoClipse/goclipse/issues/81#issuecomment-56850390 ?

sesteel commented 9 years ago

I was just giving some insight... not really for the issue, but for you.

On Thu, Sep 25, 2014 at 1:40 PM, Bruno Medeiros notifications@github.com wrote:

@sesteel https://github.com/sesteel was that meant to be an answer to #81 (comment) https://github.com/GoClipse/goclipse/issues/81#issuecomment-56850390 ?

— Reply to this email directly or view it on GitHub https://github.com/GoClipse/goclipse/issues/41#issuecomment-56872252.

bruno-medeiros commented 9 years ago

Right, I got a bit confused because your comment has nothing to do with issue #41 (which is just about GDB and debugging). Yet on issue #81 I did recently ask about 'go get'. Perhaps you replied to the wrong Github notification email? (Your comment showed up as a comment in issue #41 , the GDB one)

On Thu, Sep 25, 2014 at 9:30 PM, Stanley Steel notifications@github.com wrote:

I was just giving some insight... not really for the issue, but for you.

On Thu, Sep 25, 2014 at 1:40 PM, Bruno Medeiros notifications@github.com

wrote:

@sesteel https://github.com/sesteel was that meant to be an answer to

81

(comment) https://github.com/GoClipse/goclipse/issues/81#issuecomment-56850390 ?

— Reply to this email directly or view it on GitHub https://github.com/GoClipse/goclipse/issues/41#issuecomment-56872252.

— Reply to this email directly or view it on GitHub https://github.com/GoClipse/goclipse/issues/41#issuecomment-56879052.

Bruno Medeiros https://twitter.com/brunodomedeiros