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

Cannot set breakpoints in editor #135

Closed
abligh opened this issue Jun 30, 2015 · 7 comments
Closed

Cannot set breakpoints in editor #135

abligh opened this issue Jun 30, 2015 · 7 comments

Comments

@abligh
Copy link

abligh commented Jun 30, 2015

[ Originally reported at:
http://stackoverflow.com/questions/31056007/enabling-breakpoints-in-goclipse
where https://github.com/bruno-medeiros (who is a contributor) suggested I report here]

I'm trying to get debugging of go programs working in eclipse Luna with goclipse v0.11.0 on OS-X 10.9.5. I am using GNU gdb (GDB) 7.9.1 from brew, and go1.4.2.

I successfully installed and code-signed gdb using instructions here:

http://ntraft.com/installing-gdb-on-os-x-mavericks/

I am building my go program with -gcflags "-N -l" and I can successfully debug it at the command line, including setting breakpoints at go functions and stepping through them with the gdb command line, with source appearing as it should.

However, in goclipse I cannot set a breakpoint at all, because the 'toggle breakpoint' item on the menu is greyed out, and the 'Breakpoint Types' list says 'none available'.

If I select 'Stop on Startup at' 'main', then I can step through assembler, which is unhelpful, but proves gdb is being used.

If I keep the above option set, wait until the program hits the main breakpoint, and type (at the gdb console within eclipse) break main.foo, then cont, then a breakpoint is set in the right place, and I can step through things in the Eclipse IDE. Thus it appears the only issue is setting the breakpoints in the IDE.

The go program concerned is a single file and it works under command line gdb, and I have deleted the binary and started afresh, so this is not a 'need a rebuild' issue.

There is a screenshot at the StackExchange post linked above.

@abligh
Copy link
Author

abligh commented Jun 30, 2015

My error log has a lot of these:

Error running oracle describe for source structure update

   melnorme.utilbox.core.CommonException: GOARCH is undefined
at com.googlecode.goclipse.tooling.env.GoEnvironment.validateGoArch(GoEnvironment.java:65)
at com.googlecode.goclipse.tooling.env.GoEnvironment.getGoArch(GoEnvironment.java:60)
at com.googlecode.goclipse.core.engine.GoEngineClient$GoStructureUpdateTask.createSourceFileStructure(GoEngineClient.java:80)
at melnorme.lang.ide.core.engine.StructureModelManager$StructureUpdateTask.doRun(StructureModelManager.java:325)
at melnorme.lang.ide.core.engine.StructureModelManager$StructureUpdateTask.run(StructureModelManager.java:312)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

amb

eclipse.buildId=4.4.1.M20140925-0400
java.version=1.8.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.standard.product -keyring /Users/amb/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.standard.product -keyring /Users/amb/.eclipse_keyring -showlocation

I'm not entirely sure how to find the 'configuration log'

@abligh
Copy link
Author

abligh commented Jun 30, 2015

The GOARCH problem was simply that I hadn't set GOARCH to anything other than <default> in the settings page. Settings that removes the error. There are now no go related things of interest in the error log. It doesn't (however) solve the problem.

@bruno-medeiros
Copy link
Contributor

As described in https://github.com/GoClipse/goclipse/blob/master/CONTRIBUTING.md , the configuration is at Help/About/Installation Details/Configuration

Also, if you open the dialog at Run/Debug Configurations..., can you create and run a Go Debug launch?

@bruno-medeiros
Copy link
Contributor

Nevermind, I was able to replicate it.

@bruno-medeiros bruno-medeiros changed the title Cannot enable breakpoints in goclipse Cannot set breakpoints in goclipse editor Jul 1, 2015
@bruno-medeiros bruno-medeiros changed the title Cannot set breakpoints in goclipse editor Cannot set breakpoints in editor Jul 1, 2015
@abligh
Copy link
Author

abligh commented Jul 1, 2015

Thanks - is there some way to test this here without a local build? (e.g. a manual file edit)

@bruno-medeiros
Copy link
Contributor

I've put out a bugfix release with this fix: https://github.com/GoClipse/goclipse/releases/tag/v0.11.1

@abligh
Copy link
Author

abligh commented Jul 1, 2015

Thanks! I can can confirm that now works.

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

No branches or pull requests

2 participants