While executing C code in gdb using Eclipse, I noticed that for the variable char* sval gdb prints (on the "Expressions" tab):
- Expression: sval
- Type: char *
- Value: 0x7fffd9d79840 "BIDPRICE"
However, I know that the value must be something else (for example, "BIDZSPD"), because it was assigned a few lines above. Indeed, the value of sval[3] is "Z", as expected.
Then I noticed the following in the expression view, the same as when you mouse over a variable:
Name : sval Details:0x7fffd9d79840 "BIDZSPD" Default:0x7fffd9d79840 "BIDPRICE" Decimal:140736848173120 Hex:0x7fffd9d79840 Binary:11111111111111111011001110101111001100001000000 Octal:03777773165714100
It looks like different representations of the char pointer, but why are the details different from Default? Should I interpret "Default" as the previous value? Why is the default value displayed as the value of the expression and not the current value?
source share