The assign and the set variable Commands in Machine-Level Debugging

You can use the assign (dbx) and the set variable (gdb) commands to alter the contents of memory specified by an address as shown in the following example:

 

(idb) set $address = &(node->_data)

(idb) print $address

0x805e5f8

(idb) print *(int *)($address)

-32

(idb) assign *(int *)($address) = 1024

(idb) print *(int *)($address)

1024

GDB Mode

 

(idb) set variable $address = &(node->_data)

(idb) print $address

$11 = (int *) 0x805e5f8

(idb) print *(int *)($address)

$12 = -32

(idb) set variable *(int *)($address) = 1024

(idb) print *(int *)($address)

$13 = 1024

 

See Machine-Level Debugging for more information.