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

  • Home
  • SEARCH
  • 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 6069309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:48:32+00:00 2026-05-23T09:48:32+00:00

I ran into some problem that I want to solve efficiently and maybe some

  • 0

I ran into some problem that I want to solve efficiently and maybe some of you will learn from this too.
I made a mistake, because I debbuged my application using printf( or in my case probably std::cout) debbuging.
It went well and I removed my bug and got to other problems.
Now I am at a stage where I want my debugging output to vanish but I can not find it anymore.
Searching the text did not bring it up and is hopeless because of many non-debug prints.
Further I did not print more than a variables value so I don’t know it’s name nor can I search for this specific value as it is not in the source code.

I remember of some neat linux command that logs all syscalls in the application it wraps.
Is it possible to use this tool to find the lines where the debugging print takes place?
(I would use this because 90% of my output is this debugging print so i think i should find it quickly)

Of course if you know about a better way to solve this you are welcome to post your solution.

Thanks

EDIT
To not comment on each one who advices me to use version control: I already use SVN.
Unfortunately I do not know when I entered the debugging message.
Worst case could be that my initial commit already contains it.

The grep guys: That is not much better than the text search as it will give me each
line containing a print/std::cout and that without context, so I cant even decide if
it is a debugging line between all these others.

To all of you who tell me/think I am stupid doing these things: Well that one I noticed just as I typed in this post 😉

But let me state that I all this comes down to my laziness in former times so let this be an example for all of you how laziness leads to even more work later on.
I just needed one single debug print there so I decided to code it in the dirty way. If it had been more I probably would have used a better one.

Solved

Finally I found it, with some luck.
It was a std::cout that had hidden somewhere deeper in code(one of the base classes that had only few includes that all were system-libraries).
I tried the grep method with one -F1 to see any comments and had luck with the line in question being on the screen when grep was through.

  • 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-05-23T09:48:33+00:00Added an answer on May 23, 2026 at 9:48 am

    If it’s a printf – do a macro that will call printf adding to it the file name and line number (these are __FILE__ and __LINE__). Just name the macro printf and call ::printf for the original function.

    If it’s cout – a bit trickier, but you can try to put breakpoint there and see where it’s called from, you’ll find it in the end.

    For the next time – always use dedicated debug printing functions or wrapper macros that could be easily separated from the rest of the code by a single compiler switch.

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

Sidebar

Related Questions

I ran into the problem that my primary key sequence is not in sync
This originally was a problem I ran into at work, but is now something
I ran into this problem at my old job, and now again at my
Hey everyone. While I'm trying to learn some PHP and mySQL, I ran into
I ran into this problem while developing in Objective-C for iOS, but this should
Was experimenting with some basic http post stuff with php and ran into this
I've just started with opengl but I ran into some strange behaviour. Below I
I'm trying to create some HtmlHelper extensions and ran into a bit of a
I ran into an interesting behavior recently. It seems that if I override .equals()
I ran into this today when unit testing a generic dictionary. System.Collections.Generic.Dictionary<int, string> actual,

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.