go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 571 forks source link

Breakpoints are activated only after restarting the debugger #2723

Open kolkov opened 8 years ago

kolkov commented 8 years ago

Setting breakpoints while debugging doesn't stop the program. Only debugger restart helps (

kolkov commented 8 years ago

Before restart image After restart image

ignatov commented 8 years ago

Can't reproduce. Could you please provide an example? @dlsniper Could you reproduce this?

dlsniper commented 8 years ago

I can't from a non-web example, I'll try one in a few minutes.

kolkov commented 8 years ago

Sometimes I can set breakpoint to working debug session. But in 90% cases not((

kolkov commented 8 years ago

last 2 points I set right now not work...

image

kolkov commented 8 years ago

I set breakpoint to line 195, but it not works first time. Then I try again and code stops at line 195, but breakpoint not shown...

image

kolkov commented 8 years ago

When I try to set brakpoint again at line 195: image

dlsniper commented 8 years ago

Can you please attach the idea log? See: https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files Also make sure it doesn't contain any information you don't want to be public.

If you have anything private please send it to my e-mail address (you can take it from my github profile).

Thank you.

kolkov commented 8 years ago

@dlsniper Sent to email

dlsniper commented 8 years ago

So, I could see this in the log:

2016-08-11 01:31:08,606 [116482829]   INFO -           #com.goide.dlv.DlvVm - IN: {"id":279,"result":[{"pc":5440786,"file":"[file path removed]","line":195,"function":{"name":"[name removed]","value":5439008,"type":84,"goType":0},"Locals":null,"Arguments":null},{"pc":5502885,"file":"[file path removed]","line":76,"function":{"name":"[name removed]","value":5502048,"type":84,"goType":0},"Locals":null,"Arguments":null},{"pc":0,"file":"","line":-1,"function":{"name":"runtime.morestack_noctxt","value":4547840,"type":84,"goType":0},"Locals":null,"Arguments":null},{"pc":825741073200,"file":"?","line":-1,"Locals":null,"Arguments":null}],"error":null} 
2016-08-11 01:31:08,612 [116482835]  ERROR - llij.ide.plugins.PluginManager - null 
java.lang.NullPointerException
    at com.goide.dlv.DlvStackFrame.customizePresentation(DlvStackFrame.java:144)
    at com.intellij.xdebugger.impl.frame.XDebuggerFramesList$XDebuggerFrameListRenderer.customizeCellRenderer(XDebuggerFramesList.java:185)
    at com.intellij.ui.ColoredListCellRenderer.getListCellRendererComponent(ColoredListCellRenderer.java:76)
    at com.intellij.ui.ExpandedItemListCellRendererWrapper.getListCellRendererComponent(ExpandedItemListCellRendererWrapper.java:39)
    at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1361)
    at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1311)
    at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.java:2623)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:184)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:164)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:211)
    at javax.swing.DefaultListSelectionModel.insertIndexInterval(DefaultListSelectionModel.java:632)
    at javax.swing.plaf.basic.BasicListUI$Handler.intervalAdded(BasicListUI.java:2581)
    at javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:148)
    at javax.swing.DefaultListModel.add(DefaultListModel.java:481)
    at com.intellij.xdebugger.impl.frame.XFramesView$StackFramesListBuilder.a(XFramesView.java:388)
    at com.intellij.xdebugger.impl.frame.XFramesView$StackFramesListBuilder.a(XFramesView.java:344)
    at com.intellij.xdebugger.impl.frame.XFramesView$StackFramesListBuilder$$Lambda$1690/1613352949.run(Unknown Source)
    at com.intellij.util.containers.TransferToEDTQueue$2.process(TransferToEDTQueue.java:83)
    at com.intellij.util.containers.TransferToEDTQueue$2.process(TransferToEDTQueue.java:80)
    at com.intellij.util.containers.TransferToEDTQueue.processNext(TransferToEDTQueue.java:99)
    at com.intellij.util.containers.TransferToEDTQueue.access$300(TransferToEDTQueue.java:37)
    at com.intellij.util.containers.TransferToEDTQueue$1.run(TransferToEDTQueue.java:58)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
    at java.awt.EventQueue.access$400(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:697)
    at java.awt.EventQueue$3.run(EventQueue.java:691)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
    at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:863)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:699)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:385)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

but it doesn't appear to be related. I do however see requests going out and not being finished in delve until much later on:

2016-08-11 01:16:00,882 [115575105]   INFO -           #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.CreateBreakpoint","params":[{"file":"file","line":188}],"id":84} 
2016-08-11 01:19:42,671 [115796894]   INFO -           #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.CreateBreakpoint","params":[{"file":"file.go","line":188}],"id":85}

2016-08-11 01:22:40,178 [115974401]   INFO -           #com.goide.dlv.DlvVm - IN: {"id":84,"result":{"id":14,"name":"","addr":5439766,"file":"file.go","line":188,"functionName":"funcName","Cond":"","continue":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":{},"totalHitCount":0},"error":null} 
2016-08-11 01:22:40,179 [115974402]   INFO -           #com.goide.dlv.DlvVm - IN: {"id":85,"result":null,"error":"file.go:188 at 530116"} 
2016-08-11 01:22:40,180 [115974403]   INFO - #com.goide.dlv.DlvDebugProcess - Breakpoint exists at file.go:188 at 530116 
org.jetbrains.concurrency.Promise$MessageError: Breakpoint exists at file.go:188 at 530116

@ignatov I've sent you a forward of the mail on your JetBrains address, see idea.log.1 file right at the top.

Looking at the log lines and timestamps I don't understand what causes the gaps there but assuming it's the @kolkov doing the pauses between commands it still doesn't explain why delve does not react immediately to the commands (which would only point to a bug in Delve or a bottleneck in sending the data to delve).

dlsniper commented 8 years ago

@kolkov which Go version do you have? There are some debugging related improvements in Go 1.7, maybe could you please test against a Go 1.7 RC6 SDK and see if this still happens?

Delve currently fails on master against AppVeyor (the Windows CI) so I'm not sure if I push a new version of Delve into plugin if it's going to work or not. There are some commits which might be interesting for this issue. @ignatov / @zolotov I can link a plugin.zip build from TeamCity to be used, right? That would have the correct version not SNAPSHOT in it, no? I would link the build from https://github.com/go-lang-plugin-org/go-lang-idea-plugin/pull/2724 if so.

kolkov commented 8 years ago

@dlsniper I have built delve from source master put it into ./dlv/windows/ and now all work fast and perfect! ("тьфу тьфу тьфу!") Yes, I am on Go 1.7 RC6 SDK. Thanks!

kolkov commented 8 years ago

but freeze IDEA at line 108 (( image

dlsniper commented 8 years ago

well so we shouldn't use the latest yet. Thanks.

dlsniper commented 8 years ago

We won't be able to upgrade until Delve is green again.

zolotov commented 8 years ago

I can link a plugin.zip build from TeamCity to be used, right? That would have the correct version not SNAPSHOT in it, no?

yes, there will be correct version