Giter VIP home page Giter VIP logo

Comments (3)

Wumpf avatar Wumpf commented on June 8, 2024

I'm not familiar with WPP log tracing, but it sounds like you're applying the include removal to an autogenerated file?

Well, I guess I could add an option to keep the line breaks but I hope you understand that I won't make this the default ;)

from includetoolbox.

CyberTech avatar CyberTech commented on June 8, 2024

Oh, certainly I wouldn't expect it to be the default -- although I'm not sure it'd change the behavior during the test cycle.

As far as applying the include removal to the generated file, no, that'd be silly :)

Thanks for making the change -- I'll include the rest here in case you're curious about why.

WPP log trace is how Microsoft recommends release mode log tracing is performed, especially in drivers and such. It allows logging to be performed without formatting or context, with simply a minimal encoded ID. After the fact, tools take the information from the PDB and turn the binary log into a full log that could have come from printf and friends.

Foo.cpp
#include "foo.cpp.tmh"
// The TMH file is auto-generated by tracewpp, on a PreBuild event, based on the contents of this file

WPP_TRACE(....)


The WPP_TRACE macro is defined as varying forms, but once of the common forms is:
#define WPP_(Id) WPP_EVAL(WPP_) ## WPP_EVAL(Id) ## WPP_EVAL(_) ## WPP_EVAL(WPP_THIS_FILE) ## WPP_EVAL(LINE)

Note the LINE appended to the end. inside Foo.cpp.tmh, there is a corresponding define, generated by wpptrace:
#define WPP_ANNOTATE_Foo_cpp10005
^ where 10005 is the line that made the WPP logging call at the time tracewpp was called.

So, line 10005 is hard-coded in the TMH file, which is fine as long as all builds happen with project->build -- because then pre-build events happen, and the TMH file is re-written. If it's not re-written, as is the case here, instead the CPP file tries to resolve WPP_ANNOTATE_FOO_cpp_10004, and fails.

But, in this case, it's just compile-current-file, and the WPP info is not regenerated on a individual-file basis (nor should it be, there's a noticable startup time for the tool)

from includetoolbox.

Wumpf avatar Wumpf commented on June 8, 2024

Thank you very much for the explanation! Didn't know about it, very interesting :)

from includetoolbox.

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.