Hi, I think I have a nice simple requirement, but haven't been able to find
anything to meet it.
All I want to do is to insert a line before every C++ statement in my
application, so that the line is executed before the statement. The line
would be a diagnostic call which would put a line out to a file containing
the current line number etc being executed. This would give me a crude map
of what code was run, and help when I get a crash to know what was the last
line run before the crash.
I appreciate there are whole dev suites which can do this, and that I can
use things like exception handling to catch errors, but I'm after a nice
simple general purpose solution.
I figure if I can find something that will convert "break;" into
"{TRACE_MACRO;break;}" that would be handy, but it would have to know about
C++ lines spanning multiple file lines, and know when the start and ends of
funcitons are, etc, so I guess a crude C++ parser would be required.
Ideally it would read all the files in one directory and create similar
named ones in another, so I can compile the modified version of the app the
same way as the original.
Any hints or tips, or suggestions of better ways to meet my needs, would be
great.