Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8086175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:22:07+00:00 2026-06-05T18:22:07+00:00

I am tired of debugging a flow of my official project code – it

  • 0

I am tired of debugging a flow of my official project code – it spreads across multiple files and millions / thousands of line. Hence I started to write a C++ program that would take input file names from a file whose objective is add printf( ,FILE ,LINE); – extra debug statements after each C++ statements like:

void my_func()
{
call_other();
}
in file 1.cpp at line 1

Would become

void my_func()
{
call_other();
printf("call_other() 1.cpp 1")
}

So each file code would be parsed and this extra debug statement would be added.

But the issue comes up with various type of statements:

if(condition) statement else statement;
C++ templates
switch case
etc

I am not able to establish a grammar that I should follow, like:

If the line ends with a semicolon and next token is not ‘{‘ the add this debugging line.

I believe that there are more cases than I am thinking off. Any suggestions that I should consider before implementing the same across thousands of file accumulating to millions of line of code?

Is there a tool / known technique that I can already make use off?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:22:09+00:00Added an answer on June 5, 2026 at 6:22 pm

    If you absolutely need to do this, take a look at clang, and write a source-to-source translator that works on the AST level. There are various posts around the net that can get you started with this. One example: http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting tired of manually installing javax jar files in Maven and would
I have the following code in a project for the main navigation. It is
I'm having problems with debugging DOM changes introduced by some JavaScript code I'm running.
I'm getting tired of clearing the Debugging->Exceptions option Break when thrown to get past
I tried debugging my code in team foundation server and I was receiving an
I'm having a hard time debugging to locate the issue here. I've tried echoing
soo tired and I know I've seen this before but Google's not helping I'm
I tired my hands on bazaar(launchpad), for the reason that i can host my
I'm tired of doing long cd commands to other directories, so I want to
I'm tired of trying to send a request with SOAP. this is my xml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.