Comments (18)
Compiling with optimizations disabled might improve things. From http://golang.org/doc/gdb :
These optimizations can sometimes make debugging with gdb harder. To disable them when debugging, pass the flags -gcflags "-N -l" to the go command used to build the code being debugged.
Unfortunately there is no way yet to add this extra options to the Go build performed from Eclipse. (I want to get that done for the next release). You can try building the executable from the command-line, and then debugging it from Eclipse (place the executable somewhere in the GoClipse project, then right-click and do "Debug As").
Also, what is your platform? Is it Windows? That could be another problem because debug output support in Windows seems buggier than in Linux (this is a problem with the Go toolchain itself, not GoClipse)
from goclipse.
Also, what is the full output of the gdb console in Eclipse? (not the gdb traces console)
from goclipse.
Unfortunately there is no way yet to add this extra options to the Go build performed from Eclipse. (I want to get that done for the next release). You can try building the executable from the command-line, and then debugging it from Eclipse (place the executable somewhere in the GoClipse project, then right-click and do "Debug As").
Just tried that after compiling it with -gcflags "-N -l" y hand, did not change the result. For testing I replaced the existing bin/main executable before debugging (it was not compiled newly before debugging, I checked with md5sum)
Also, what is your platform?
I'm on Linux x64
Also, what is the full output of the gdb console in Eclipse?
warning: Missing auto-load scripts referenced in section .debug_gdb_scripts
of file /home/panmari/go_workspace/gort/bin/main
Use `info auto-load python-scripts [REGEXP]' to list them.
The target endianness is set automatically (currently little endian)
from goclipse.
And if I list the python-scripts
info auto-load python-scripts
Loaded Script
No /usr/local/go/src/pkg/runtime/runtime-gdb.py
from goclipse.
On the golang gdb page they state
To help GDB find the Go runtime sources and the accompanying support script, pass your $GOROOT with the '-d' flag
Can I add such arguments in Debug Configuration > Debugger > GDB Debugger ? Doesn't seem to work for me, though.
By making a symlink from /usr/local/go
to /opt/go
and adding
add-auto-load-safe-path /
to the .gdbinit in the project home, I could get rid of the error in gdb. It now says
Loading Go Runtime support.
The target endianness is set automatically (currently little endian)
But the issue mentioned in the initial comment still remains.
from goclipse.
I was about to point you to the thread detailing how to deal with loading the Go debugging runtime ( https://groups.google.com/forum/#!topic/goclipse/ce8vJn3KU9s ) but it seems you got there already.
If the initial problems remains, I need more info. Can you post a minimal Go source that reproduces the problem? Also, what is your GDB version?
from goclipse.
Hmmm, I'll try to find one.
I'm using the default gdb from the repositories of Ubuntu 14.04:
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
from goclipse.
Even this little example
package main
import (
"fmt"
)
func main() {
a := "Test"
fmt.Println(a)
}
Can not show debugging informations when stoped on fmt.Println(a)
, see screenshot attached:
I used golang 1.3.1, gdb 7.7, eclipse luna for generating this. I compiled the binary through the console with debugging flags (-gcflags "-N -l") and made sure gdb had go runtim support using the configuration mentioned above.
from goclipse.
Can you try again the example above with the latest Goclipse (0.8.1) ? If the problem persists, please attach the full contents of the "gdb traces" console, and the normal "gdb" console. (You can use https://gist.github.com/ to upload attachments)
from goclipse.
Nope, still the same behavior. See gdb output
https://gist.github.com/panmari/aecbc7395b77d4095f8f
and gdb traces
https://gist.github.com/panmari/bad22281ed0b31beb68c
from goclipse.
I also have the same issue. My platform is Windows 7 64-bit. The problem is I get weird values in the Variable window. I cannot do debugging in the situation like this. Please help.
I use the latest version of Goclipse. IDE is Eclipse Luna. GDB version 7.8 (64-bit). And GO language (64-bit).
from goclipse.
I am on Mac and GDB 7.8
A lot of variables shows up empty
from goclipse.
@csterryliu I'm afraid variable inspection doesn't work on Windows. This is a limitation of the Go toolchain, not Goclipse. I've added that info the UserGuide though.
from goclipse.
@sunshineo That looks like it might be a different issue. Please take a look at
https://github.com/GoClipse/goclipse/blob/latest/documentation/ReportIssue.md#debugger-issues and if the problem persists open a new issue.
from goclipse.
@panmari I just tried that basic hello world with a local variable in Lubuntu, with the command-line GDB, and the display of local vars didn't work either... They either are missing or show garbage values. So, this seems to indicate it's a go toolchain problem. I'd like to investigate this further though, check in with the Go user group.
from goclipse.
@bruno-medeiros the faulty display of variables is also mentioned here: https://code.google.com/p/go/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Stars%20Release%20Owner%20Repo%20Summary&groupby=&sort=&id=8256
I'm having the same issue on Mac. Basically, debugging seems to generally broken in a way that is not GoClipse related.
I'll check how far I get with a gccgo based build...
from goclipse.
The Go issue is now at: golang/go#8256
We'll keep an eye on that issue to see if the debugging situation improves.
In the meanwhile, if someone could experiment with gccgo to see if the debug support there is better, that would be helpful.
from goclipse.
I've had quite a hard time getting the full toolchain to work with gccgo on Mac. I've gotten to a point where the compiler seems to work but I still don't get all dependencies/packages of projects to be linked correctly. I'll keep trying it a bit more but I cannot currently allocate a lot of time to this effort...
from goclipse.
Related Issues (20)
- Auto running gofmt does not work HOT 10
- go installation directory can't save HOT 1
- Support creation of new Build Targets
- Console Doesn't Show (ever) HOT 2
- gocode.exe eliminated, why? HOT 2
- No executable created
- Option button on outline view to sort alphabetically
- "guru" does not work properly in Goclipse. HOT 2
- goclipse seems to be looking in /usr/local/go even If I set it to use another location in preferences HOT 6
- How to run a Unit Test for GO like Junit for JAVA HOT 1
- Project doesn't build if it doesn't have a src folder HOT 4
- keyword highlighting dont work?
- The goto label should have autocomplete support
- Outline not correct on open when a struct definition is spread among more than one file
- lint on specific file
- could not start goclipse because java version is 0 HOT 5
- Fail to build lint and work fine inside terminal in MacOS
- 在eclipse上运行go项目报Executable file (D:\work_space\sad\bin\main.exe) doesnt exist. HOT 1
- Got this error when install GoEclipse
- goclipse and gocode doesn't work form golang version 1.10!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goclipse.