Home > Backend Development > C++ > How Does the Visual Studio Debugger Display Special Types, Methods, and Variables?

How Does the Visual Studio Debugger Display Special Types, Methods, and Variables?

Barbara Streisand
Release: 2025-01-13 06:38:44
Original
705 people have browsed it

How Does the Visual Studio Debugger Display Special Types, Methods, and Variables?

Special naming conventions in the Visual Studio debugger

Question:

Where can I find information about the special display conventions used by the Visual Studio debugger for certain types, methods, fields, and local variables?

Answer:

Note on undocumented implementation details:

These naming conventions are undocumented implementation details of the compiler and may change without notice. However, for educational purposes we provide some insights based on the current implementation.

Special names for specific scenes:

  • Unused/deleted local variables: Variables starting with '__Deleted$'.
  • Temporary variable allocated by the compiler: CS$X$Y, where X represents the type of the temporary variable and Y represents the allocated number.

Temporary variable type value:

  • 0: short-lived temporary variable
  • 1: Return value temporary variable
  • 2: Lock statement temporary variable
  • 3: using statement temporary variable
  • 4: Persistent temporary variables
  • 5-7: Temporary variables related to foreach loop
  • 8-264: Multidimensional array index storage
  • 264: Fixed string temporary variable

Additional special names for constructs generated by special compilers:

  • Auto attribute supports fields: 'k'
  • Anonymous method closure class: 'DisplayClass'
  • Anonymous type field: 'Field'
  • Anonymous type type parameter: 'TPar'
  • Iterator state: 'state'

Pattern to generate special names:

The common mode is: PC__SI

  • P: For cached delegate and display class instances, use CS$
  • N: original name
  • C: Scenario-based magic code (1-s)
  • S: descriptive suffix
  • I: Optional unique identifier

For example, a local variable created for the iterator's current value would be named "PC__current".

The above is the detailed content of How Does the Visual Studio Debugger Display Special Types, Methods, and Variables?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template