Live Watch Plugin Development Guide

Sysprogs forums Forums VisualGDB Live Watch Plugin Development Guide

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #33955
    murrellr
    Participant

    Is there a guide for developing Live Watch plugins?  I’m not very familiar with C# but I was able to determine from the source files on Github that program variable names are gleaned from the ELF file.  What I’m looking for is a description on how Live Watch works and the various classes and interfaces that are available and ones that the developer must implement.  Something that the average C# developer could use to develop their own plugin.

    Feature Request: It would be great if a Live Watch Plugin Wizard existed that would let the user pick and choose variables to create screens without writing any code.  A bonus would be to scan the source code for structure fields without the user from having to define them manually.

    #33956
    bflannery
    Participant

    I would second enabling Live Watch to infer the type from the source code as a feature.

    #34020
    support
    Keymaster

    Hi All,


    @murrellr
    , sorry for the delay. We are still working on a comprehensive reference of the live watch API, similar to the expression visualizers API reference. We expect it to be finished in 1-2 weeks from now, and will also publish a detailed documentation page explaining the key concepts.

    As for the wizard, writing code (and creating plugins) is only needed for complex scenarios (e.g. scanning heap, detecting object types, displaying them as lists).

    For simple use cases, you can just use the “globals” view under the Live Watch. It automatically locates all variables in the ELF file, and lets you quickly locate/view the ones you need. If you would like to just view a group of key variables, you can simply tag them as favorite, and then use the favorite-only view. If it helps, we can add a mode for virtual views, where you would create group nodes and drag some variables underneath them.


    @bflannery
    , could you please elaborate more on what you meant? The live variables in the global view are automatically inferred from the ELF symbols (and there is even an option to show their values right in the code editor). If you meant something different, it would be great if you could provide an example.

    #34035
    murrellr
    Participant

    For complex operations, I was thinking of a built in scripting engine (javascript, python, perl, etc.) that would allow the user to massage the data before displaying it.  Not all of us are proficient in C#.

    #34036
    support
    Keymaster

    Hi,

    Sorry, adding a scripting engine in another language (and making sure the scripts are debuggable) would be orders of magnitude more complex than reusing the .Net framework that is already used for Visual Studio extensions, and VisualGDB itself. It would also very likely cause compatibility problems with other extensions, or some Visual Studio versions, due to the sheer complexity of this solution.

    If you are not familiar with C#, we can gladly add a few tutorials showing some basic use cases, so you could tweak the logic shown there without having to go in-depth into the C# semantics. Let us know if you have any use cases in mind.

    #34054
    support
    Keymaster

    Hi,

    OK, we have published a detailed reference covering the live watch plugin API here: https://visualgdb.com/reference/extensibility/html/N_VisualGDBExtensibility_LiveWatch.htm

    We also published 2 tutorials that should help anyone interested get started with Live Watch plugins:

    We will publish another tutorial on discovering multiple objects and iterating lists next week.

    The tutorials assume no prior C# knowledge, so they explain all key concepts, show how to use Visual Studio to setup the projects, add classes, etc. They also cover the non-trivial C# syntax that is different from C++.

    If you have any feedback regarding the new documentation, feel free to post it here.

     

    #34056
    murrellr
    Participant

    Thank you for your efforts creating this content.

     

    #34065
    support
    Keymaster

    Hi,

    No problem. We have also added another tutorial showing how to discover statically defined objects (i.e. global variables of given types) and dynamically created ones as well (by traversing linked lists).

    If you absolutely do not want to deal with C#, you can try using IronPython – it allows creating .Net objects and implementing .Net interfaces using Python. You will get to use the Python syntax instead of C#, but the rest of the functionality (implemented interfaces, general semantics, etc) will be the same. There is also Python .Net, although it appears to mostly target a different use case.

    If this doesn’t work and you would like us to develop a completely custom scripting engine based on your requirements, we can do it as a paid custom feature. Feel free to draft a specification showing the features you would like to see, and we can give you a quote. We can also schedule a call to discuss the requirements, prepare a spec draft, and send it to you for review. Feel free to reach out to our sales if you would like to explore this direction, and we will try our best to find a solution that will work.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.