Access to debug variables in a Eclipse CDT plugin - eclipse-plugin

I want to create an Eclipse plugin which can get access to the same data that is presented in the variables view when debugging a C/C++ application. For example I want to create a view that can present variables from the debugger in different ways.
I have looked in the CDT Developer guide but couldn't find anything about this.
First I thought I could create a SelectionListener and extract the data I want when the user clicks on a variable in the VariableView but I get an instance of GdbVariableVMNode which is internal and not useful. Can I adapt this into something?
Am I supposed to use the CDebugCorePlugin or is there another interface into CDT debugging?

I found out myself. I can use the org.eclipse.debug.ui.memoryRenderings extension point. It lets me provide a class implementing IMemoryRendering, the init method will provide me with an instance of a IMemoryBlock from which I can get the actual values from debugged variables.

Related

How to add an ABAPDoc for a method that is an enhancement of a standard class?

I have extended a class by one method, using the Enhancement Framework.
Now, my problem is that I want to add ABAPDoc to it but cannot find any way to do it!
The code in the Enhancement Include section seems to be editable in no way.
Is there any way to do it at all? I tried also from ADT in Eclipse but this calls the SAP GUI anyway.
What are you trying to do is indeed impossible.
The enhancement include is a technical object and it cannot be edited from the tab you highlighted, it is auto-generated as you changing pre- and post-methods.
What this tab shows is not an include itself, but the placement of the enh. include within the parent object
If you want to change the method comment from enhancement, you should go to Technical details tab and click on changed object, or just go to the class in SE24 and press to pre/post exit button, and you will end up in the same include:
You can write the ABAPDoc-syntaxed comment, but for me it didn't work, and Eclipse didn't recognized my comment written in SAPGui, maybe you will be luckier.
ABAPDoc team describes this piece in a fuzzy manner, it may be an expected behavior:
This ABAPDoc is only available to ADT and not SE80? I can not use it in SAP GUI development?
You can also write it in the source code and you will get also warnings when you execute a check, but there is no dedicated tools support like source code element information or quick assist (Ctrl+1)
To your principal question, ABAPDoc is a two-way road when viewing: the ABAPDocs can be viewed both from the Eclipse and SE80, and they are automatically showed in SE80 description fields (but only if they are declared synchronized).
But it seems to be a one-way road for edit: they can be created only in ADT Eclipse to be fully compatible. If the object cannot be opened in Eclipse natively like your enhancement you are out of the luck.
I put seems because I am not 100% sure. Maybe on later systems it was fixed, but on my 750 they are not recognized by Eclipse for enhanced methods.
The only reliable way of "editing" via SE80 is writing the comments to descriptions and then importing these SE80 descriptions into ABAPDoc in Eclipse
which is ridiculous in context of your question, so there is no way for you.

Get the results of an (existing) code inspection

I am new to writing intellij plugins, so I apologize in advance if my question might be a bit unclear.
I know that (live) code inspections are achieved via Annotators or LocalInspectionTools. I also know there is an API to write a custom Annotator or Inspection tool and I have seen several examples.
What I do not know (my question): is there a manager/helper/"global inspector" that can provide me with the results of an existing code annotator/inspection process (done by the IDE's plugins or by some 3rd party plugin)?
For instance: I do not want to write a custom Lint annotator/inspection plugin for WebStorm. One can configure JSLint/JSHint inside WebStorm settings. The results of the live inspection can be seen over the current file/current open editor.
I would like to get the results of this live inspection, that occurs in the current open editor (inside my own custom code). For this I am interested in the API to get this annotator/inspector and/or the results it provides.
(I apologize for maybe using annotator and inspection terms in a confusing manner)
If there is another question (which I could not find) that duplicates what I have asked above, please re-direct me.
Thank you in advance!
Andrei.
Unfortunately regular annotating process for the linters is asynchronous so you cannot get the annotation results directly (by calling 'Manager' method).
You can create instances of JSLintInspection, JSHintInspection, etc. and call #createVisitor().visit(File) method but the operation is very slow and you must call it outside of AWT thread.
Also you can try to run the method com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx#processHighlights but as I mentioned above the annotation results for linters can be not available (or outdated)

How to find a method where used in intellij

Is there a way to find one method where used in intellij idea with golang plugin ?
I need to find the method all where used.
Anyone who know how to do this?
Find Usages is for sure the right way how it was already mentioned. However, if you don't want going through the context menu, you could also use the shortcut Alt + F7 for Windows/Linux or Option + F7 for Mac OS. You can also specify the Find Usages Scope which can be, for example, only production files or only test classes. Other shortcuts could be found from here.
Unfortunately if you use Ubuntu this shortcut is already reserved for some system operation and to make it working in Intellij IDEA you need to disable it in OS level.
Right click on the method name and select "Find Usages". This will find direct callers of the concrete method. If you want to find callers who call the method via an interface, it's harder. If you know the interface(s), you can navigate to each of them in turn and right click on the method name and select "Find Usages". If you don't know which interfaces include the method, Go Oracle can help.
Unfortunately, the Find Usages on a method finds every method of that same name, so if you use a common method name, it will find a lot more than you want. For example, I am debugging legacy code that had a method called clone(), not an override, just a new method. When I did a Find Usages on it, it found over 1000 entries, most of which were in the JDK, which clearly did not call the method of interest.
My solution was to slightly rename the clone() method to cloneXYZ() and rebuild. The compiler showed me the 5 calls I was looking for.

Visual studio intellisense only showing after calling the right module

Been having this issue for a while now, tried to google it, but don't now really how to ask google this properly, so will try it here.
I made my own dll's, each containing different vb.net modules, each with different functions.
So for example I have a vb.net module called 'Helper', with the functions 'helper1', 'helper2', 'helper3'..
So I want to call it in a website like 'Helperdll.Helper.helper1()'.
Problem is that the intellisense already shows the functionames before I typed the modulename. So it's possible for me to call 'Helperdll.helper1(). And I want this to dissapear.
I already tried to add this just before the function. This hides indeed the functionname for the intellisense, but is not really what I'm looking for. :
'<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)>'
So my question: Isn't it possible to add a rule like this one above on top of the module (so not for every function seperatly) or fix something in the properties of the dll which will hide the functionnames until the right module has been called?
That is a feature of VB.NET's Modules, it's called Type Promotion. There is no way to deactivate this behaviour.
Check if you really need a Module or if a class with Shared members would serve the same purpose for you.
Just saw that there already is a question like this: VB.NET Module - Can I force the use of <Module_Name>.Public_Member_Name when accessing pub. Members?

Having trouble debugging class library plugin

I have a windows form application in which I'm attempting to utilize a plugin (class library). In the code I have it load the assembly from a dll file, which means I have not been able to debug. Furthermore I have not found out how to compile the library so I've had to use the debuged dll version for testing. I've run into a bug in which I create a new object and send that data through an interface to the plugin in an attempt to retrieve a blank slate group box from the plugin. However instead of reading the parameter as a new object i managed to step through the code once (don't ask me how, I don't know and I haven't been able to repeat it) and it appeared that the code was registering the parameter as "nothing" thus why I received a null reference error in the main program.
Is there a better way to debug this mechanism and find out where the problem is? Any ideas on what the problem could be. As I read over this is seems somewhat vague and I'm not sure how to describe it, but I'm willing to host a connect now meeting if anyone is willing to look at what is going on and I'm not making myself understood very well.
I'm not sure if I follow exactly what you're doing but I usually find that the best way to debug a class library is by in the solution for the class library I add a new project, either a WinForms one or a Console one, I then set this new project as the start up project and add a reference to the Class Library project (via the Project tab in the Add Reference dialog).
You'll then be able to call the methods in the class library from the other project and you can put breakpoints anywhere to see what's really going on easily.
Ok, so the problem was that any time you edit the class library you have to compile (and the only way I know how is debugging, I can't find a compile button and the publish button doesn't work and building doesn't appear to make a dll). But anyways you have to compile, transfer the file so you are reading the most recent one. If you edit the code during runtime it does NOT update the dll in use...which was my problem.