This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Dynamic code changes
- From: Brian Blietz <bblietz at iastate dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 16 Jan 2004 05:01:58 -0600
- Subject: Dynamic code changes
I am trying to implement dynamic code changes in programs compiled with gcc.
I have used the CFG (Control Flow Graph) implementation in GCC 3.2 to
break the code into basic blocks.
In each block, I have inserted a unique ID for the block. This unique
ID is used to identify the flow of the program.
The code looks something like this:
pushl (Unique ID)
call Some_func
Some_func will use the unique ID in an arbitrary manner, which is not
important.
What I would like to do, is go through the program and recalculate these
unique ID's for each of
the blocks EVERY time it is run.
I really don't know where to start. ANY help would be much appreciated.
Brian