How to debugger for custom language generating C++ during preprocessingin VS2019?

Peeyush Chaurasia 0 Reputation points
2023-03-17T05:19:39.2866667+00:00

Hi,

We are using custom language say FileName.xyz which on precompilation preprocessing temporarily generates C++ files, which in turn is built to an executable (and PDB for temporary C++ files symbols).

We want to Debug this Filename.xyz using exe and PDBs.

the difference between FileName.xyz and generated FileName.cpp is that

  1. CPP file has additional code #include etc. in the beginning so 1st stmt in xyz may appear at 11th line in cpp
  2. to map line differences and filename at line 10th in FileName.cpp it puts #line 1 FileName.xyz

is used to set __LINE and __FILE before 1st statement

  1. also each "custom language statement;" is inline replaced in CPP with their function definition "n-comma separated statements;" (same way as #define functions get replaced during pre-processing).

In Visual Studio 2019:

  1. How Can I debug FileName.xyz (place brakepoint, check variable values/callstack, F9, F10, F11, Shift+F11) using standard C++ debugger with exe and generated pdbs for C++ file?
  2. I need some explicit mapping for .xyz file to debugger, and .xyz to .cpp pdbs, but what exactly not sure and how?
  3. do I need Custom debugger for this?
Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
214 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
998 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.