Use SOS.dll from Windbg extension - plugins

I am trying to write a plugin for windbg using the wdbgexts.h and was wondering if there was a way for me to use SOS.dll from my windbg extension so that I don't need to redefine a ton of structures. I can't seem to find any information on if its header is available and I have tried digging through the Windows 10 SDK which is where I found examples for writing a extension.
If the header is not available would I basically need to rebuild the structures I need from here to interact with managed code?

Related

VS Code / IDEs: How can I enable cmd+click goto definition for variables declared at runtime?

I'm looking to improve my own productivity by trying to figure out how to provide cmd+click functionality for variables declared at runtime. I work with a library that allows you to register objects to it at runtime to be accessed later — it would be great if I could cmd+click to definitions of these! How do you think I could achieve this? I'm open to any ideas. Thanks!
Edit:
Thoughts I have so far inspired by feedback from various Slack communities:
There is no such thing as 'runtime' when providing functionality in IDEs
We need to be able to teach the IDE about what definitions to expect. Whether this means writing an extension to use the VS Code API specifically for my use-case, or otherwise working within a system that generates files that the IDE already knows to look for, which allows it to connect the dots and provide the precious peek / goto definition functionality
Edit:
I'm starting work on a VS Code extension that reads a dotfile for configuration — I'll share what I find out as I go!

Can I create VS Code extensions in Python/C++?

I am totally new to creating extensions in VS Code, and all the official examples of extensions are written in Typescript/Javascript, which I have no experience with. Is it possible to create VS Code extensions in other languages, such as Python or C++?
If so, could anyone point me to any resources to get me started?
It is possible by creating a C++ module for Node.js, which can then be loaded like any other node module. Of course, some glue code written in JS or TS is necessary to register the extension and translate calls to/from vscode.
I've gone this way in my ANTLR4 extension, but gave up eventually, because of the troubles I had due to incompatible dependencies (you have to make sure the extension uses the exact same V8 version, which was used to build the underlying Node.js used by vscode, on all supported platforms).
This situation might have change, I don't know, but with that in the background I don't recommend it.
If you want to add support for a new language in vscode you can also write a separate language server, as is mentioned in the linked SO answer. For other type of work, I'm afraid, you have no alternative to use.
No, as #rioV8 said, since VSCode is an electron app and runs on Javascript.

Distribute a glade file inside an application

Before I start, I know of the existence of GResource, however I'm using gtkmm (C++), and I'm not sure if GResource works with C++. I can't find anything along the lines Glib::GResource, and I've been looking for a while.
Anyway, I'm writing a GUI using Gtkmm, and I want to pack the .glade file which I load within the executable, so that the executable can be run without having to have a file next to it. I'm not sure that I completely understand how GResources work, and I can't find any clear instructions anywhere.
So, using Gtkmm, how would I pack a .glade file inside my executable?
update: I've found this. (Gio::Resource), which sounds hopeful, but no documentation.
I've made some more research and found this tutorial and this documentation. Looks like what you need is Gio::Resource::lookup_data_global. Below is C version of my answer.
When something in glib world lacks documentation, it's time to read documentation for c. In short: with the help of glib-compile-resources and a simple xml file you build a .c file, which can be compiled into your application. After that you can use g_resources_lookup_data (resourceS, it's important) to load data.

Why can't I debug into UnityEngine.UI code?

I add the UnityEngine.UI.dll and UnityEditor.UI.dll to my assets folder with their mdb files . also i add the both project to my current project. i am sure all the unity engine ugui code build success, because i debug log in the event system, and it print message. when i want to step into the event system class, i always failed . I find unity will load the code from a build path ,rather than i original code. Why does it do this ? if i want to debug unity engine ugui code, what should i do ?
To debug code, you need two things:
Symbols, the list of all functions, classes, variables used throughout the module. When using C++ symbols are stored in special .pdb files on Windows (and you obviously are using Windows since you are talking about dlls). Symbols in C# (.NET in general) are stored in the .dll itself. Having symbols will let you see the name of functions on the call stack and possibly some variables but nothing more.
Source code of the module.
U3D's source code is proprietary - you need to spend a good amount of money to receive it. And if I am guess to - UnityEngine.UI.dll is a C++ module with stripped (removed) symbols removed.
Thus you have neither, so you can't debug U3D's code at all.
Why would you need to that anyway? If you want to see how the internals of a big game engine work, there are plenty of other options (for example UE4 and Lumberyard). If you are struggling with a problem and you'd like to be able to solve it through debugging...well though luck. Your best bet would be to ask in unity community.

Is there a way to load python scripts from a zipfile in ironpython

I want to have extensions to my application written in IronPython. Part of those extensions will use decorators, and so I wish to include the decorator module in the package.
The issue is that the decorator depends on several modules existing in the IronPython distribution, and those modules depend on other modules and so on.
The easiest solution would be to include the entire Lib folder in the application, but that would increase the footprint by 500 files and 12 mb.
To avoid that I'm trying to zip the modules and load them from the zip file instead of directly from the filesystem, but I haven't found a straightforward way to do so.
I've spotted the importer mechanism for loading modules via a "path_hooks" global , which seems to give me access to something similar to the imp mechanism in Python, but I'm not sure of how to use it.
Is there a hook for the import mechanism in IronPython that I'm missing?
How should I go about implementing this?
What you want is zipimport support, which isn't implemented yet. If you'd like to help out with that I can put you in touch with the guy who's working on it.
Otherwise, it looks like you might just need to stub out the bits of inspect.py that decorator.py needs.