x/debug: add expression types &x and *x.

Support for the address operator uses two new value types.
The result struct produced for an expression &x contains the DWARF type
of x, and a value of type pointerToValue containing the address of x.
We don't use the DWARF type of &x, because the program's DWARF
information may not contain that type if it's not used in the program.

When evaluating the operand of an address expression, we don't want to
return the value of the operand, since we need the address.  So we add
a parameter getAddress to evalNode and resultFrom, and when getAddress
is true and the result of the expression is an addressable value, we
return a value of type addressableValue containg the address.  Then when
evaluating the node for &x, we convert the addressableValue to a
pointerToValue, or return an error if x was not addressable.

Change-Id: I1f513e8ec4b3ac249cf45516a9410db9a6afca6d
Reviewed-on: https://go-review.googlesource.com/16034
Reviewed-by: Dave Day <djd@golang.org>
3 files changed