Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

CDT Based Debugger Produces GDB Errors During Debugging Sessions #41

Closed
sesteel opened this issue Feb 14, 2014 · 5 comments
Closed

CDT Based Debugger Produces GDB Errors During Debugging Sessions #41

sesteel opened this issue Feb 14, 2014 · 5 comments
Labels

Comments

@sesteel
Copy link
Member

sesteel commented Feb 14, 2014

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 

@sesteel sesteel added the bug label Feb 14, 2014
@bruno-medeiros
Copy link
Contributor

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
Copy link
Member Author

sesteel commented Sep 25, 2014

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 #41.


Reply to this email directly or view it on GitHub
#41 (comment).

@bruno-medeiros
Copy link
Contributor

@sesteel was that meant to be an answer to #81 (comment) ?

@sesteel
Copy link
Member Author

sesteel commented Sep 25, 2014

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)
#81 (comment) ?


Reply to this email directly or view it on GitHub
#41 (comment).

@bruno-medeiros
Copy link
Contributor

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)
#81 (comment)
?


Reply to this email directly or view it on GitHub
#41 (comment).


Reply to this email directly or view it on GitHub
#41 (comment).

Bruno Medeiros
https://twitter.com/brunodomedeiros

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants