Click here to Skip to main content
15,887,376 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to print all source code what was running? Pin
Member 1308136925-Jan-19 4:24
Member 1308136925-Jan-19 4:24 
GeneralRe: How to print all source code what was running? Pin
Richard MacCutchan25-Jan-19 4:46
mveRichard MacCutchan25-Jan-19 4:46 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 2:01
Stefan_Lang28-Jan-19 2:01 
AnswerRe: How to print all source code what was running? Pin
Stefan_Lang25-Jan-19 3:29
Stefan_Lang25-Jan-19 3:29 
GeneralRe: How to print all source code what was running? Pin
Member 1308136925-Jan-19 4:30
Member 1308136925-Jan-19 4:30 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 0:42
Stefan_Lang28-Jan-19 0:42 
QuestionRe: How to print all source code what was running? Pin
David Crow25-Jan-19 4:44
David Crow25-Jan-19 4:44 
AnswerRe: How to print all source code what was running? Pin
k505425-Jan-19 6:31
mvek505425-Jan-19 6:31 
Or a watchpoint that only triggers when a variable changes value? Otherwise, go through and add printf() or cout at "interesting" points. You should be able to wrap those in #ifdef _DEBUG macros so you don't have to pull them out in Release version. A really smart cookie might figure out how to use variadic marcros, #ifdefs, etc so you could do something like
int main()
{
   DEBUG_LOG("starting main\n");
   int i = 0, j = 0;
   DEBUG_LOG("i = %d, j = %d\n");
   int n = foo(i,j);
   DEBUG_LOG("foo(%d,%d) returned %d\n", i, j, n);
   DEBUG_LOG("main exits\n");
}

If you're using straight C, then vprintf() might help. C++ might need the use of variadic templaytes (C++11 and later - see c++ - How to make a variadic macro for std::cout? - Stack Overflow
QuestionRe: How to print all source code what was running? Pin
David Crow25-Jan-19 6:46
David Crow25-Jan-19 6:46 
GeneralRe: How to print all source code what was running? Pin
Member 1308136925-Jan-19 13:51
Member 1308136925-Jan-19 13:51 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 0:52
Stefan_Lang28-Jan-19 0:52 
AnswerRe: How to print all source code what was running? Pin
Member 1308136925-Jan-19 13:43
Member 1308136925-Jan-19 13:43 
AnswerRe: How to print all source code what was running? Pin
Randor 25-Jan-19 13:51
professional Randor 25-Jan-19 13:51 
GeneralRe: How to print all source code what was running? Pin
Member 1308136926-Jan-19 12:53
Member 1308136926-Jan-19 12:53 
GeneralRe: How to print all source code what was running? Pin
Randor 26-Jan-19 15:43
professional Randor 26-Jan-19 15:43 
GeneralRe: How to print all source code what was running? Pin
Member 1308136926-Jan-19 22:40
Member 1308136926-Jan-19 22:40 
GeneralRe: How to print all source code what was running? Pin
Randor 28-Jan-19 4:30
professional Randor 28-Jan-19 4:30 
GeneralRe: How to print all source code what was running? Pin
Member 1308136930-Jan-19 12:22
Member 1308136930-Jan-19 12:22 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 1:32
Stefan_Lang28-Jan-19 1:32 
GeneralRe: How to print all source code what was running? Pin
Randor 28-Jan-19 4:13
professional Randor 28-Jan-19 4:13 
GeneralRe: How to print all source code what was running? Pin
Stefan_Lang28-Jan-19 21:12
Stefan_Lang28-Jan-19 21:12 
AnswerRe: How to print all source code what was running? Pin
Victor Nijegorodov26-Jan-19 5:26
Victor Nijegorodov26-Jan-19 5:26 
GeneralRe: How to print all source code what was running? Pin
Member 1308136926-Jan-19 12:05
Member 1308136926-Jan-19 12:05 
GeneralRe: How to print all source code what was running? Pin
Victor Nijegorodov27-Jan-19 0:02
Victor Nijegorodov27-Jan-19 0:02 
GeneralRe: How to print all source code what was running? Pin
Member 1308136928-Jan-19 1:38
Member 1308136928-Jan-19 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.