Windbg sets the debug MSG output information level

Source: Internet
Author: User
Tags bit set

After Vista, the debug information can be output conditionally using dbuplintex or kdprintex. (The previous 2003 Server or XP is an unconditional output, which needs to be encapsulated and set the debug information level)

The information level of dbuplintex in windbg is defined as follows:

  • IfLevelIs equal to a number between 0 and 31, aggressive, it is
    Interpreted as a bit shift. The importance bit field is set to the value
    1 <Level. Thus choosing a value between 0 and 31Level
    Results In a bit field with exactly one bit set. IfLevelIs 0, the bit
    Field is equivalent to 0x00000001; ifLevelIs 31, the bit field is
    Equivalent to zero x 80000000.
  • IfLevelIs a number between 32 and 0 xffffffff random Sive,
    Importance bit field is set to the valueLevelItself.
  • Common levels include:
    # Define dpfltr_error_level 0
    # Define dpfltr_warning_level 1
    # Define dpfltr_trace_level 2
    # Define dpfltr_info_level 3
    # Define dpfltr_mask 0x8000000

    In windbg, You can dynamically modify the debug output level:
    Kd>Ed kd_ihvvideo_mask 0x8 
    Set kd_xxx_mask in windbg command mode. In the above command, ihvvideo indicates setting the mask of the video driver.
    Note that the specified mask also requires ored.Win2000System-wide mask (0x1 ).

    How to filter debug information:
    1> If the level is less than or equal to 31, judge whether (1 <level & kd_ihvvideo_mask) is 0. If not, the output is
    2> If the level is greater than 31, directly determine (Level & kd_ihvvideo_mask) to determine whether to output

    BTW: it does not seem to work in windbg v6.6, but this method is feasible in windbg v6.7.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.