How to modify GCC so to insert some code for debug?
John
kkxkkx@gmail.com
Fri Mar 23 14:33:00 GMT 2007
Hi,
I use GCC to compile the code that runs in a very resouse-limited embed system,
so I can't use the usual debug tools, such as GDB. And there are thousands of
lagacy code already, in which there is no debug code, sth like
PRINT(__FILE__, __LINE__).
So I want to modify the GCC to meet the requirement below:
1. In each funtion entry and exit, print out some info, such as the
funtion name, time, etc.
2. Before each loop(for/while/until) and branch selection, print out
the condition info.
For exmaple:
for(i = ...) while(j < ...), if(i > ...), print out the value of i.
3. More advanced, when a variable is accessed, its value is printed.
Like the watch command in GDB.
Could some gurus give me some suggestions? Such as is there a project
aimed at this? How long/difficult
does it take if I make it from scratch?
Thanks,
John
More information about the Gcc-help
mailing list