Change a program variable.
assign target = ["filename"]value
target |
The variable, memory address, expression, or data member to be changed. This target can include a class name, object, pointer, or any other expression that describes how to access the memory that is to be assigned a value. Use the normal language syntax to specify the target. For example, if you are targeting a class member variable, use classname::variable. |
filename |
The name of the source code file that includes the variable you want change. You can include this parameter when you want to refer to a rescoped expression. |
value |
The new value for the variable, memory address, or expression. |
This command changes the value of a program variable, memory address, or expression that is accessible according to the scope and visibility rules of the language. The expression can be any expression that is valid in the current context.
For C++, use the assign command to modify static and object data members in a class, and variables declared as reference types, type const, or type static. You cannot change the address referred to by a reference type, but you can change the value at that address.
Do not use the assign command to change the PC. When you change the PC, no adjustment to the contents of registers or memory is made. Because most instructions change registers or memory in ways that can impact the meaning of the application, changing the PC is very likely to cause your application to calculate incorrectly and arrive at the wrong answer. Access violations and other errors and signals may result from changing the value in the PC.
(idb) assign x = 0 (idb) assign p->s.f[i] = 1 (idb) assign A::B::m = 2 (idb) assign *((int *) 0x12345678) = 4
Copyright © 2001-2011, Intel Corporation. All rights reserved.