*: Fix go vet complaints (#1935)

* *: Fix go vet struct complaints

* *: Fix struct vet issue on linux

* *: Ignore proc/native in go vet check

We have to do some unsafe pointer manipulation that will never make go
vet happy within the proc/native package. Ignore it for runs of go vet.
This commit is contained in:
Derek Parker
2020-03-18 09:25:32 -07:00
committed by GitHub
parent edc5436fe3
commit ad75f78c4e
27 changed files with 166 additions and 136 deletions

View File

@ -263,7 +263,7 @@ func TestCoreFpRegisters(t *testing.T) {
}
// in go1.10 the crash is executed on a different thread and registers are
// no longer available in the core dump.
if ver, _ := goversion.Parse(runtime.Version()); ver.Major < 0 || ver.AfterOrEqual(goversion.GoVersion{1, 10, -1, 0, 0, ""}) {
if ver, _ := goversion.Parse(runtime.Version()); ver.Major < 0 || ver.AfterOrEqual(goversion.GoVersion{Major: 1, Minor: 10, Rev: -1}) {
t.Skip("not supported in go1.10 and later")
}
@ -368,11 +368,12 @@ mainSearch:
}
scope := proc.FrameToScope(p.BinInfo(), p.CurrentThread(), nil, *mainFrame)
v1, err := scope.EvalVariable("t", proc.LoadConfig{true, 1, 64, 64, -1, 0})
loadConfig := proc.LoadConfig{FollowPointers: true, MaxVariableRecurse: 1, MaxStringLen: 64, MaxArrayValues: 64, MaxStructFields: -1}
v1, err := scope.EvalVariable("t", loadConfig)
assertNoError(err, t, "EvalVariable(t)")
assertNoError(v1.Unreadable, t, "unreadable variable 't'")
t.Logf("t = %#v\n", v1)
v2, err := scope.EvalVariable("s", proc.LoadConfig{true, 1, 64, 64, -1, 0})
v2, err := scope.EvalVariable("s", loadConfig)
assertNoError(err, t, "EvalVariable(s)")
assertNoError(v2.Unreadable, t, "unreadable variable 's'")
t.Logf("s = %#v\n", v2)