From: Grzegorz J. <ja...@ac...> - 2004-07-23 10:46:08
|
Hi, It seems to me that when you only insert new code, then the original code should stay untouched. OpenC++ will also generate #line directives around the inserted code, so that line number information is correct. They are missing in your sample. Could you post the code which you use to insert the statement? BR Grzegorz Raphael Yokoingawa de Camargo wrote: > 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...> > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Opencxx-users mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencxx-users |