diff --git a/src/getting-started/03.00.DEBUG.md b/src/getting-started/03.00.DEBUG.md index 7d11595..08559f6 100644 --- a/src/getting-started/03.00.DEBUG.md +++ b/src/getting-started/03.00.DEBUG.md @@ -87,15 +87,15 @@ $1 = 42 $2 = (i32 *) 0x10001fdc (gdb) print _y -$3 = 134219052 +$3 = -1 (gdb) print &_y $4 = (i32 *) 0x10001fd8 ``` As expected, `x` contains the value `42`. -`_y` however, contains the value `134219052` (?). -Because `_y` has not been initialized yet, it contains some garbage value. +`_y` however, contains the value `-1` (?). +Because `_y` has not been initialized yet, it contains `-1`. The command `print &x` prints the address of the variable `x`. The interesting bit here is that GDB output shows the type of the reference: @@ -108,7 +108,7 @@ Instead of printing the local variables one by one, you can also use the `info l ``` (gdb) info locals x = 42 -_y = 134219052 +_y = -1 ``` OK. With another `step`, we'll be on top of the `loop {}` statement: