Next: , Previous: , Up: Mapping   [Contents][Index]


25.16.8 Auto-Remapping

By default poke always tries to handle mapped values in a transparent way, i.e. in the same way than if the values weren’t mapped. To guarantee that the contents of mapped values are always up to date, it issues remaps every time the value gets referenced.

For example, consider the following Poke program:

var arr = X86_Insn[1024];

There, an array of 1024 x86 instructions arr is mapped. Every time the array value is referenced it is re-mapped from the corresponding IO space. For example:

arr[2].opcode = 0x0b;

In the reference above, the whole array should be re-mapped from IO space, because x86 instructions are variable-length, so it is necessary to re-read all the previous values before accessing the element in position 2.

This re-mapping 100% guarantees that the mapped values are up to date. However, this can get very slow, depending on the data structures we are poking at.

poke offers a way to turn this auto re-mapping off. In Poke code:

vm_set_autoremap (0)

Or using the poke application CLI:

(poke) .set autoremap no

When auto-remap is switched off, mapped values are used as-is. It is then the responsibility of the user to explicitly re-map values using the remap operator. Like:

(poke) remap arr