提交 dc3fca3f 编写于 作者: A Alessandro Arzilli 提交者: Derek Parker

service: add backend to GetVersion response (#1641)

Implements #1640
上级 7bcb9ace
......@@ -415,6 +415,7 @@ type GetVersionIn struct {
type GetVersionOut struct {
DelveVersion string
APIVersion int
Backend string // backend currently in use
}
// SetAPIVersionIn is the input for SetAPIVersion.
......
......@@ -1207,6 +1207,27 @@ func (d *Debugger) ListDynamicLibraries() []api.Image {
return r
}
func (d *Debugger) GetVersion(out *api.GetVersionOut) error {
if d.config.CoreFile != "" {
if d.config.Backend == "rr" {
out.Backend = "rr"
} else {
out.Backend = "core"
}
} else {
if d.config.Backend == "default" {
if runtime.GOOS == "darwin" {
out.Backend = "lldb"
} else {
out.Backend = "native"
}
} else {
out.Backend = d.config.Backend
}
}
return nil
}
func go11DecodeErrorCheck(err error) error {
if _, isdecodeerr := err.(dwarf.DecodeError); !isdecodeerr {
return err
......
......@@ -387,7 +387,7 @@ func (cb *RPCCallback) Return(out interface{}, err error) {
func (s *RPCServer) GetVersion(args api.GetVersionIn, out *api.GetVersionOut) error {
out.DelveVersion = version.DelveVersion.String()
out.APIVersion = s.s.config.APIVersion
return nil
return s.s.debugger.GetVersion(out)
}
// Changes version of the API being served.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册