Depends on what changes you want to make. Assuming that you want to make changes to the address space, copy the ExecutionState via the copy constructor (or ExecutionState::branch) and then use the AddressSpace::getWritable function for each object that you want to modify to activate the copy-on-write mechanism.
Paul On 28/10/12 23:38, Jonathan Neuschäfer wrote: > On Sun, Oct 28, 2012 at 09:56:36PM +0800, Qiuping Yi wrote: >> Hi, >> >> Who can tell me how to clone a new ExecutionState b of an exist >> ExecutionState a, >> and the change on b won't affect a? >> >> when I tried to use " ExecutionState *b = new ExecutionState(a); " to get a >> copy b of a, and did >> some change on b, I found a is also changed. > > Executor::fork() may be part of what you're looking for. > > Jonathan Neuschäfer > _______________________________________________ > klee-dev mailing list > [email protected] > http://keeda.Stanford.EDU/mailman/listinfo/klee-dev > _______________________________________________ klee-dev mailing list [email protected] http://keeda.Stanford.EDU/mailman/listinfo/klee-dev
