x/debug: use arch's functions for reading floats and complex numbers.

Change-Id: Id1adfc0c52f3d7a02cc01ecb0db6f9ad61ab4352
Reviewed-on: https://go-review.googlesource.com/12348
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/ogle/program/server/print.go b/ogle/program/server/print.go
index 3d671ae..6c4be72 100644
--- a/ogle/program/server/print.go
+++ b/ogle/program/server/print.go
@@ -7,7 +7,6 @@
 import (
 	"bytes"
 	"fmt"
-	"math"
 
 	"golang.org/x/debug/dwarf"
 	"golang.org/x/debug/ogle/arch"
@@ -192,9 +191,9 @@
 		}
 		switch typ.ByteSize {
 		case 4:
-			p.printf("%g", math.Float32frombits(uint32(p.arch.UintN(buf))))
+			p.printf("%g", p.arch.Float32(buf))
 		case 8:
-			p.printf("%g", math.Float64frombits(p.arch.UintN(buf)))
+			p.printf("%g", p.arch.Float64(buf))
 		default:
 			p.errorf("unrecognized float size %d", typ.ByteSize)
 		}
@@ -206,13 +205,9 @@
 		}
 		switch typ.ByteSize {
 		case 8:
-			r := math.Float32frombits(uint32(p.arch.UintN(buf[:4])))
-			i := math.Float32frombits(uint32(p.arch.UintN(buf[4:8])))
-			p.printf("%g", complex(r, i))
+			p.printf("%g", p.arch.Complex64(buf))
 		case 16:
-			r := math.Float64frombits(p.arch.UintN(buf[:8]))
-			i := math.Float64frombits(p.arch.UintN(buf[8:16]))
-			p.printf("%g", complex(r, i))
+			p.printf("%g", p.arch.Complex128(buf))
 		default:
 			p.errorf("unrecognized complex size %d", typ.ByteSize)
 		}