I am looking to instrument a near-production application to simply print the stack trace when a variable is modified. I don't want to halt-thread or halt-VM.
What is a best and least complex approach?
Do I need to write my own plugin to handle 'DebugElement'?
Do I need to write a custom Debug Adapter?
Are there any examples out there? I know about EclipseCon2005_Tutorial21-v2 (Darin Wright, Bjorn Freeman-Benson) example for an Eclipse debug plugin contains deprecated code (e.g., "IPluginDescriptor").
I'm trying to follow Vogella's tutorial but some things are not clear enough.
Ah, just call a method from the conditional expression. It can do what is needed, and then "return false;" so that the VM is not suspended.
Related
Trying to use Super Dev mode with a GWT 2.1.5 project.
I have configured Super dev mode (it works) I can see the sources in Javascript debugger, can use breakpoints, however I cannot evaluate variables at execution time.
Is there any trick to have Google Chrome's javascript debugger not trip on local variables evaluation ? Do I need to find another name for the variable (the actual name of the variable, not the name that is in the sources ?) for evaluation ?
See below.
edit: actually I think I have found part of the answer in GWT's official page. "When inspecting variables in the Chrome debugger, the field names and values are JavaScript, not Java.". I have no idea where those names can be seen, though, any help ?
Perhaps you could try switching off obfuscation? This is described in this document FAQ - Debugging and Compiling - Why is my GWT-generated JavaScript gibberish?. You could try the compiler parameters -style PRETTY or -style DETAILED
Also: the SDBG project allows source map debugging within the Eclipse IDE. There is a GitHub bug report on the issue you describe. It might help you: Add support for mapping field names.
I think it might be related to this question Why does Chrome debugger think closed local variable is undefined?
It is incredibly annoying for debugging purposes though, and any means to circumvent it would be welcome.
I have created my own custom toolchain plugin for CDT, and it works pretty well. However there is one piece that I cannt figure out.
Goal
Create a Tool which calls a JAVA class, instead of sending a command line argument.
At first I mulled over the 'CustomBuildStep' option for the Tool plugin element, but that is not the solution. How can you do this?
Hello World Request
Here's a simple one - At the completion of the CDT-Managed Build (e.g. the make call completes), I would like to pop a message box that says 'Hooray!'.
Current Workaround
Currently I end up just doing
java -cp "some_obtuse_path_into_plugins_dir" MyClass.doPopup
This is a gnarly console output, and a total hack in my opinion.
Thoughts?
Here is a useful contextual answer (that doesn't answer my question, but may point to 'sorry, can't do that):
Stack Overflow: Eclipse-CDT: Whats the best way to add a custom build step?
Have you considered creating a new Nature for your project: http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FresAdv_natures.htm ? Then you can define your own builder to call the particular code you want.
I don't know how this would fit in your workflow, but it might a solution.
I want to have a possibility to decode error stacktraces that appear in the production environment.
If you kept your symbolMap around, yes; e.g. check out
http://code.google.com/p/speedtracer/wiki/ResymbolizationProtocol
(disclaimer: never tried it, myself)
you need to use the JsEmulateStackTrace class. Its seemly very complex and have never really gotten around to implementing it fully myself.
http://code.google.com/p/google-web-toolkit/wiki/WebModeExceptions
this hypothetically remaps your symbol map for you, but honestly i doubt it works fully as i haven't seen a library/module yet that provides proper stack tracing for gwt. So that tells me its pretty hard or not fully working.
honestly it might be better to create some code to inject at compile time that provides stack trace support, that allows you to generate your own stack trace rather then using the actual java script stack trace. IE.. you might be able to create a single base class for all of your classes that you compile. With maybe an annotation or something. Then have your build script extend all of your classes pre compile so they are transparent to the dev, but included with the compiled cache file. You could have your base class grab the class name and or method name or something. and manage it with a simple stack that you can pop.
I am working on writing an IDE for Scala and need some help. I would like to implement coding assistance so that I could present a list of options when a user presses a period (".") or a space (" "). e.g. if projects is a List, as soon as user types "projects." or "projects ", I would like to show all methods of scala.List that he could use (regular IDE stuff). I know that scala.tools.nsc.interactive package provides this capability, but I am unable to figure out how to do it. Besides, it seems that the interactive package would use REPL and would be slow for this purpose. Is that a fair assumption, and if yes, are there any alternatives?
Also, is there a way I could get a call reference tree for a literal/ method (where all is the method referred to in a code base) ?
Thanks and Best regards
Aishwarya
Well, your best bet is going through the same set of links I provided in answer to this question, even though the questions are different.
Yes, the presentation compiler under scala.tools.nsc.interactive is where the reusable functionality would be.
The presentation compiler is used by Eclipse and ENSIME. May be ENSIME itself which in addition to providing emacs support also provides a server as a backend for an editor would be a good avenue.
The presentation compiler is not slow. It was designed from the ground up to provide good performance for Eclipse and it has largely delivered on this goal.
For some of the presentation compiler capabilities, see scala.tools.nsc.interactive.CompilerControl.
For another project using ENSIME, look at Daniel Spiewak's plugin for jEdit.
Like firebug's console,I can type in the scripts directly.
Is there a similar place in eclipse out there?
Or do I install some plugin to have the feature?
You can use the Display window to type in code snippets, set variable values and evaluate whilst debugging.
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/views/display/ref-display_view.htm
The "watch" view can be used to execute simple snippets of code.
In some circumstances, I use the groovy shell (in a separate window) to check how a code snippet will behave. It isn't practical when complex data structures or library classes are involved, but for a respectable number of cases it works very well.
You can use the Expression and Display views. There's a set of excellent free video tutorials on the Eclipse debugger that you can see here. The aforementioned views are talked about in lesson 3.