I'm working for a company, that does not have a habit of adding log entries in their source code.
Hence, if something goes wrong, the amount of logs, explaining what might have happened, is too small to make any real analysis.
Therefore I'm looking for a tool which can do the following:
- Attach to a running process and link to the symbols file.
- Follow all lines of source code which are executed.
- After a certain key is pressed (like "Ctrl+C"), produce a report which looks as follows:
[]
file1.c:010: function1(1, 2, 5)
file1.c:011: sum(1,2)
file1.c:020: return 3;
file1.c:012: sum(3,5);
file1.c:020: return 8;
file1.c:012: return 8;
I can imagine this question sounding very naïve, but if I can have something which just approaches this result, it might be very useful.
Does anybody know if this can be achieved using windbg, cdb, Visual Studio or any other means?
do you have the source code and symbols for your exe if yes windbg can step and print source lines
demo below for a simple recv sample
start an executable whose pdb with src info is available
windbg breaks on system breakpoint
enable loading of line information enable stepping in source mode enable printing of src lines
disallow all other output except src
go to main and step 10 times you will see each step is showing the src
read and use controlling the target in windbg help to know about various execution methods like step until return , step until branch etc