Giter Site home page Giter Site logo

windbg-libraries's Introduction

Introduction

This is a collection of libraries for extending WinDbg.

Build and Test

To build on any of these libraries you can download the files locally or add our Nuget package to your project.

Contribute

Contributions are welcome, you can:

  • Submit bugs and help us verify fixes.
  • Submit pull requests for bug fixes and features and discuss existing proposals
  • Ask questions, open an issue and prefix the issue title with [Question]. See Question tag for already-opened questions.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Please refer to Contribution Guidelines for more details.

License

Code licensed under the MIT License.

windbg-libraries's People

Contributors

alanatwork avatar aluhrs13 avatar glitchnsec avatar lzybkr avatar microsoft-github-policy-service[bot] avatar wmessmer-msft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windbg-libraries's Issues

DbgModelClientEx.h IDataModelManager4, IDeconstructableConcept and IFilteredNamespacePropertyToken Don't Exist

The IDataModelManager4 and IDeconstructableConcept COM interfaces do not exist anywhere and the client library cannot compile. I have to replace the manager with the only existing version (2) inside DbgModel.h and completely comment out the IDeconstructableConcept code in the client to get it to compile. Would be great to get this fixed asap since it makes the client library unusable.

Thanks!

Accessing a child symbol by std::wstring results in infinite recursion

Example snippet:

ClientEx::Module hostModule{ hostContext, moduleName };
ClientEx::Symbol functionSymbol = hostModule.FindSymbol(functionName);

return Object::FromSymbol(functionSymbol.Children()[variableName]);

TSymChild SymbolChildrenRef::operator[](_In_ const std::wstring& fieldName) const attempts to recursively call TSymChild operator[](_In_z_ const wchar_t *childName). Since the latter is not const, the former is called, implicitly creating a new std::wstring, and execution recurses infinitely.

[Question] Calling native functions on models from a debug session

Hello,

Is it possible to call functions on an object from a debug session? I've got objects from the top frame of the callstack and can get their type, iterate over the native fields, etc, but I haven't found a way to call or even list all the functions on these objects.

By modifying FromExpressionEvaluation to take in a context model for the "this" pointer I'm able to successfully evaluate a function name (e.g. "utf8_str") against a specific object and the api returns that it is a function and I can query its return type but I'm not sure how I can then execute it and inspect what it returns.

Ultimately what I'm trying to do is create an ExtensionModel for a class in the target and be able to call a function so I can make a display string using its result. Sorry if this is more DbgEng / DbgModel specific than just the c++ wrapper library but there's very little information on how to use all these debugging apis.

Thanks.

Constructing a TypeSignature by signature and module name does not work as expected

I found that my TypeSignatureExtension extension model was not matching the type successfully when constructed with the signature and module name. This overload is calling IDebugHostSymbols::CreateTypeSignatureForModuleRange and passing nullptr for the minimum and maximum version parameters. Though that call succeeds I don't think the actual signature is valid, at least it is not matching as expected.

The expectation seems to be that calling CreateTypeSignatureForModuleRange but not providing a version range should produce an equivalent signature object to calling IDebugHostSymbols::CreateTypeSignature with the signature and an IDebugHostModule*. The documentation for CreateTypeSignatureForModuleRange and the referenced CreateModuleSignature suggest that this should work. Could this be a bug in DbgModel?

If I update the constructor to first get the IDebugHostModule using IDebugHostSymbols::FindModuleByName and pass that to CreateTypeSignature, everything works as expected.

The referenced constructor overload:

// TypeSignature(signature, moduleName)
//
// Creates a type signature for a type whose name and module name matches the supplied string signatures.
//
template<typename TStr1, typename TStr2,
    typename = std::enable_if_t<!std::is_same_v<typename std::decay_t<TStr2>, Module>>>
    TypeSignature(_In_ TStr1&& signature, _In_ TStr2&& moduleName)
{
    const wchar_t *pSignature = Details::ExtractString(signature);
    const wchar_t *pModuleName = Details::ExtractString(moduleName);
    ComPtr<IDebugHostSymbols> spHostSym;
    ClientEx::CheckHr(ClientEx::GetHost()->QueryInterface(IID_PPV_ARGS(&spHostSym)));
    ClientEx::CheckHr(spHostSym->CreateTypeSignatureForModuleRange(pSignature, 
        pModuleName, 
        nullptr,
        nullptr,
        &m_spTypeSignature));
}

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.