6 ms·
Google Cloud Debugger: use local source, Go and Node.js support, IntelliJ plugin
- Estragon 11y agoIs there an emacs package for this? Is the server code open-source as well?
- erezhaba 11y agoemacs package don't exist yet as far as I know. But the API's are open and should be easy to write. I think that the hard part would be the UI for displaying variables and stacks. The server side code is not open-source, mainly for use of internal technologies. But why do you really need it? Google offers it's usage for free.
- cheez 11y agoI know this is the future, cloud development, but... I can't help feeling like I'm going to lose something.
- deleted 11y ago[deleted]
- mikegerwitz 11y agoYou are: https://www.gnu.org/philosophy/who-does-that-server-really-serve.html https://www.gnu.org/philosophy/who-does-that-server-really-s... But many (most?) are willing to accept that trade-off. I haven't researched this at all, but if you can use your own software on your own computer (e.g. IntelliJ) for the debugging UI, then you retain control over at least _part_ of your computing.
- erlichmen 11y agoIt's funny that I can debug Go in the cloud while debugging Go on my local computer is near impossible.
- sillysaurus3 11y agoI tried to download someone's Go repo that operated on gifs, but on my machine it died with an error inside of the standard library's compression code, which failed with a cryptic message. I spent the next 30 minutes trying to figure out how to add printline debugging to the standard library. I saw the precise line of code it was failing on, so I added some logging code above it to print out more info. Nothing happened. I tried to rebuild the file. There was no obvious way to do this. I googled for "golang recompile standard library." There was no clear, simple answer. I seemed to be expected to read all of the documentation in order to do this seemingly-simple thing. I went on Freenode and asked how to do it. Crickets. I was being intellectually lazy, a cardinal sin. Obviously, the solution was to read the documentation, learn about GOPATH, learn how and why the source code was laid out the way it was, understand how to make my own package, then try to figure out how to make changes to existing packages. But it's a step backwards. I'm staring at the code. I made changes to it. Why does it require a magical incantation to make those changes have an effect? Why can't it detect that the code changed, and do whatever's necessary to apply those changes? Or at least let me type "go make zlib.go" and be done with it? Yeah, "make" isn't a valid command. I'm supposed to "build" a package. But I'm not trying to build a package. I'm trying to run someone's freshly-cloned Go project. The whole thing made me feel dumb and outdated.
- frik 11y agoThe whole GOPATH and directory magic is really bad and outdated. In almost every other language I can place my files wherever I want and write a build script. I like everything else about Go and hope they remove that cruft from such a great language in version 2 or so. Go should learn from C/C++ in this regard.
- Nitramp 11y agoI see that the exact other way around. With other languages, every project decides on their weird local directory layout for no good reason at all, and then everyone has to write build scripts to keep things working. Learning from C++ builds seems like a cruel joke – not sure if trolling or not ;-)
- orf 11y agoI'm really interested as to how they inspect Python applications without slowing it down. I know the PyDev debugger adds significant overhead, which is due to it's use of stackframe inspection/function call hooks (as far as I know). How can they put a breakpoint/inspect objects at arbitrary locations without this slowdown? Maybe they have a modified cPython interpreter? Edit: lots of C code is the answer[1] 1. https://github.com/GoogleCloudPlatform/cloud-debug-python/tree/master/src/googleclouddebugger https://github.com/GoogleCloudPlatform/cloud-debug-python/tr...
- erezhaba 11y agoThey Python Cloud Debugger uses a combination of line trace debugging (which is very slow) and the profiling callback (fast) to inspect the line of interest. The Cloud Debugger is different from your tradition debugger as it optimizes for application speed. For example, it would capture values, let the thread continue and run, and only then serialize is back to the Cloud Debugger server.
- erezhaba 11y agoVlad is right, now it does codebyte rewrite. using the trace and profiling interface was the old way.
- vlflnd 11y agoThe Python Cloud Debugger works with the standard (unmodified) CPython 2.7.x. Breakpoints are implemented by rewriting Python bytecode at runtime. The debugger inserts a method call at the breakpoint location in a code object. This method tells the debugger that the code reached a particular point. Generator functions are particularly tricky because they need to maintain correct offsets at "yield" points. This source file implements all of it: https://github.com/GoogleCloudPlatform/cloud-debug-python/blob/master/src/googleclouddebugger/bytecode_manipulator.cc https://github.com/GoogleCloudPlatform/cloud-debug-python/bl...
- amelius 11y agoIt would be nice if this could capture the state of client and server, and deterministically rerun events on both client and server. But I guess that is not in the realm of current technology.
- vlflnd 11y agoUnfortunately there is no good way to capture the state of the client. For example in JavaScript there is no access to local variables of a function.
- amelius 11y agoTrue, but if you replay all events that lead to a certain state, you will end up in the same state. Of course, you will need to make wrappers around certain system functions, e.g. the clock, etc.
- danellis 11y agoDoes the Java support mean that this will work with any JVM language supported by IntelliJ? (Specifically Scala in my case.)
- erezhaba 11y agoIn theory, however the current released agent rejects any snapshots (breakpoints) set on files with extension other than Java. see the current agent code on https://github.com/GoogleCloudPlatform/cloud-debug-java https://github.com/GoogleCloudPlatform/cloud-debug-java
- trungonnews 11y agoForget Go remote debugging. How do we debug Go locally with IntelliJ?
- jakevn 11y agoInstall IntelliJ Go plugin (I use alpha): https://github.com/go-lang-plugin-org/go-lang-idea-plugin https://github.com/go-lang-plugin-org/go-lang-idea-plugin Configure project SDK for Go. Right click main.go -> Select debug I'm using IntelliJ 15 on OS X. Not certain it's as easy on all platforms.
- tkubacki 11y agoDart support please! Since there is a vm debug protocol in Dart - seems doable.
- erezhaba 11y agoThe Cloud Debugger has open API's and plugin model. Anyone can write a Cloud Debugger agent, for any language, and have it integrated seamlessly to the Cloud Debugger experience. There Cloud Debugger service exposes the clouddebugger API, which actually has two parts. The Debugger (which is intended for the UI) and the Controller (which is intended for the agent to interface). see https://cloud.google.com/debugger/api/ https://cloud.google.com/debugger/api/
- dstroot 11y agogodebug. Nuff said.