Giter VIP home page Giter VIP logo

Comments (12)

gregg-miskelly avatar gregg-miskelly commented on July 19, 2024 2

I have committed a fix for this. Baring something unexpected, it should ship in VS 2019 version 16.2 preview 3.

from concordextensibilitysamples.

gregg-miskelly avatar gregg-miskelly commented on July 19, 2024 1

Have you seen these --

What happens after you add WorkerProcessSupported="true"? Does everything build successful, but you are seeing problems when running? Or you are running into build problems?

If you are running into problems when running: is your extension loading in the worker process? In case you are not aware: the easiest way to debug this would be to launch devenv.exe under either a native or mixed-mode debugger (ex: Enable 'Unmanaged code debugging' in your launching project's project properties), and use the Microsoft Child Process Debugging Power Tool to automatically debug the msvsmon process for managed-only debugging.

from concordextensibilitysamples.

CsabaStupak avatar CsabaStupak commented on July 19, 2024

Thanks for the hints. I will try the Child Process Debugging Power tool. Meanwhile I did some progress :-)

If add WorkerProcessSupported="true" to vsdconfigxml my IDkmCustomVisualizer is loaded to the external process.I was able to find that it is "msvsmon". So I attached VS to this process and indeed my EvaluateVisualizedExpression is called.

However my method is pretty complex and I work here with (PDB) symbols and do additional evaluations. For example I call DkmLanguageExpression.Create and DkmVisualizedExpression.EvaluateExpressionCallback for which I get exception saying that I can't call these methods from external process.

Now it is starting to make sense that I need to communicate with my VS extension process via DkmCustomMessage (from the article). However for me it is crucial to work with active instance of DkmVisualizedExpression (root/children).

How can I transfer it to VS extension process so it will be active? Or how can I call expression evaluations from VS extension process? E.g.

"pGeom!", "pGeom->size()" or "((MyGeomClass*)0x0ffff2342)->size()"

from concordextensibilitysamples.

gregg-miskelly avatar gregg-miskelly commented on July 19, 2024

Both DkmLanguageExpression.Create and EvaluateExpressionCallback should be callable from within a worker process. Are you creating your own DkmInspectionContext? If so, make sure to call the new overload that has a 'SymbolsConnection' argument.

If that isn't it, can you share more details of where you are seeing the exception? Either copy/paste the arguments you are passing, or save a dump file to drop box/one drive/etc and email me (greggm on the microsoft.com email server) a link to it.

from concordextensibilitysamples.

brunov28 avatar brunov28 commented on July 19, 2024

Hi,

I have a similar problem with our IDkmCustomVisualizer extension. It is working fine when Load debug symbols in external process is unchecked but when it is checked I get this warning

Warning: IDkmCustomVisualizer::EvaluateVisualizedExpression() failed. The object will be formatted without the custom visualizer.

Our extension dll and vsdconfig is deployed here C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Packages\Debugger.

I have tried to add Debugger.Lauch() call in every entry point of our dll but none gets called. I also tried using Microsoft Child Process Debugging Power Tool without success.

Here is a sample of my vsdconfig.xml

<Class Name="DebugComponentDLL.DebugComponent" WorkerProcessSupported="true">
  <Implements>
    <InterfaceGroup>
      <Filter>
        <VisualizerId RequiredValue="6A9197EE-22BD-433A-BF1B-9D8863D87058"/>
      </Filter>
      <Interface Name="IDkmCustomVisualizer"/>
    </InterfaceGroup>

  </Implements>
</Class>

Any help would really help as we like to use the new out of process debugging feature.

from concordextensibilitysamples.

CsabaStupak avatar CsabaStupak commented on July 19, 2024

Hi Bruno,

I believe your extension is loaded to VS external process - like my is loaded if I adjust the vsdconfig.xml WorkerProcessSupported="true". The key point is here that you should attach your debugger to msvsmon process which is automatically created by VS when you launch your target application. That process contains your loaded extension as well - at least in my case it works fine. You can try Microsoft Child Process Debugging Power Tool (extension to VS) referred above, which does this automatically.

However we are apparently limited what VS API methods can be called in this process. In my case I can't call DkmLanguageExpression.Create nor DkmSuccessEvaluationResult.Create. They throw exception E_XAPI_METHOD_UNAVAIL_IN_WORKER_PROCESS. This is blocker in my case, because when VS asks to visualize the expression I do sometimes raw expression evaluation or some other kind of expression evaluation (e.g. function calls). Without these methods my visualization is impossible - or I was not able to find an alternative.

Hope this helps :-)
Csaba

from concordextensibilitysamples.

gregg-miskelly avatar gregg-miskelly commented on July 19, 2024

Thanks. I was able to track down the problem. There isn't a good work around right now aside from either disabling out-of-process symbols, or implementing your custom visualizer in C++. We will work on getting this addressed in a future update of Visual Studio 2019.

from concordextensibilitysamples.

brunov28 avatar brunov28 commented on July 19, 2024

Hi Csaba,

My extensions needs to call DkmLanguageExpression.Create and DkmSuccessEvaluationResult.Create. So I have the same problem. Thanks for the heads-up.

Looking forward for a fix in a future update of VS2019.

Bruno

from concordextensibilitysamples.

gregg-miskelly avatar gregg-miskelly commented on July 19, 2024

VS 2019 16.2 preview 3 has now shipped in the Visual Studio Preview Channel. This contains my fix for this issue. If you were running into this problem, please install the preview channel and test out your scenarios.

from concordextensibilitysamples.

brunov28 avatar brunov28 commented on July 19, 2024

Now that 16.2 has officially shipped I tried to use our custom visualizer with worker process but it did not work. The extension work if I disable the load debug symbols in external process but if it is enable I get this warning.

Natvis: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Packages\Debugger\Visualizers\CustomPlugin.natvis(4,4): Warning: IDkmCustomVisualizer::EvaluateVisualizedExpression() failed. The object will be formatted without the custom visualizer. Error code: 0x8ede0023.

Anyway to debug this or is there any sample that I can look at.

Thanks.

from concordextensibilitysamples.

gregg-miskelly avatar gregg-miskelly commented on July 19, 2024

@brunov28 lets close this issue and open a new one. The failure you are running into is E_XAPI_COMPONENT_DLL_NOT_FOUND. So please include how you are installing your extension, and how it is implemented. See links above and in the wiki for information on how to install for worker process support, and a sample c++ custom visualizers implemented in C++.

from concordextensibilitysamples.

brunov28 avatar brunov28 commented on July 19, 2024

Sure created a new issue #48

from concordextensibilitysamples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.