1
0
mirror of https://github.com/beego/bee.git synced 2025-06-23 18:50:25 +00:00

Use Delve v0.12.1 instead of master

This commit is contained in:
Faissal Elamraoui
2017-03-26 16:55:28 +02:00
parent abf3c41032
commit 4dd6983d3c
67 changed files with 448 additions and 925 deletions

View File

@ -9,8 +9,7 @@ import (
"reflect"
"strconv"
"github.com/derekparker/delve/pkg/proc"
"github.com/derekparker/delve/proc"
"golang.org/x/debug/dwarf"
)
@ -99,19 +98,6 @@ func prettyTypeName(typ dwarf.Type) string {
return r
}
func convertFloatValue(v *proc.Variable, sz int) string {
switch v.FloatSpecial {
case proc.FloatIsPosInf:
return "+Inf"
case proc.FloatIsNegInf:
return "-Inf"
case proc.FloatIsNaN:
return "NaN"
}
f, _ := constant.Float64Val(v.Value)
return strconv.FormatFloat(f, 'f', -1, sz)
}
// ConvertVar converts from proc.Variable to api.Variable.
func ConvertVar(v *proc.Variable) *Variable {
r := Variable{
@ -133,9 +119,11 @@ func ConvertVar(v *proc.Variable) *Variable {
if v.Value != nil {
switch v.Kind {
case reflect.Float32:
r.Value = convertFloatValue(v, 32)
f, _ := constant.Float64Val(v.Value)
r.Value = strconv.FormatFloat(f, 'f', -1, 32)
case reflect.Float64:
r.Value = convertFloatValue(v, 64)
f, _ := constant.Float64Val(v.Value)
r.Value = strconv.FormatFloat(f, 'f', -1, 64)
case reflect.String, reflect.Func:
r.Value = constant.StringVal(v.Value)
default:

View File

@ -87,9 +87,7 @@ func (v *Variable) writeTo(buf io.Writer, top, newlines, includeType bool, inden
}
data := v.Children[0]
if data.Kind == reflect.Ptr {
if len(data.Children) == 0 {
fmt.Fprintf(buf, "...")
} else if data.Children[0].Addr == 0 {
if data.Children[0].Addr == 0 {
fmt.Fprintf(buf, "nil")
} else if data.Children[0].OnlyAddr {
fmt.Fprintf(buf, "0x%x", v.Children[0].Addr)

View File

@ -8,7 +8,7 @@ import (
"strconv"
"unicode"
"github.com/derekparker/delve/pkg/proc"
"github.com/derekparker/delve/proc"
)
var NotExecutableErr = proc.NotExecutableErr