From: Raphael Y. de C. <rca...@im...> - 2004-07-22 22:11:57
|
Hi, I am writing a C++ precompiler to modify an application to automatically save its state periodically. For doing this, I need to insert new statements in function bodies. The problem i am encountering is how to insert these new statements. In the first version of this precompiler I am using the command Ptree::Make. The problem of using this command, is that all the original statements after the insert ones appear on the same line, and not on different lines as before. For example: ckp_save_stack_data("temp.dat"); // Added by the precompiler printf ( "testInt = 1: %d\n" , testInt ) ; printf ( "testDouble = 2.1: %f\n" , testDouble ) ; ckp_npop_data(5); The modifications are being done at the function ClassWalker::TranslateBlock. Does anyone know how to solve this? Thanks, Raphael Raphael Yokoingawa de Camargo <rca...@im...> |