From b9fea20df7dd0bd1279ae80c99f9bc9969e1fe5a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 7 May 2018 13:05:41 +0200 Subject: pkg/report: remove duplicated stub code Update #538 --- pkg/report/akaros.go | 40 ---------------------------------------- pkg/report/fuchsia.go | 40 ---------------------------------------- pkg/report/report.go | 6 +++--- pkg/report/stub.go | 40 ++++++++++++++++++++++++++++++++++++++++ pkg/report/windows.go | 40 ---------------------------------------- 5 files changed, 43 insertions(+), 123 deletions(-) delete mode 100644 pkg/report/akaros.go delete mode 100644 pkg/report/fuchsia.go create mode 100644 pkg/report/stub.go delete mode 100644 pkg/report/windows.go (limited to 'pkg') diff --git a/pkg/report/akaros.go b/pkg/report/akaros.go deleted file mode 100644 index 46d20590a..000000000 --- a/pkg/report/akaros.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2017 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -package report - -import ( - "regexp" - - "github.com/google/syzkaller/pkg/symbolizer" -) - -type akaros struct { - kernelSrc string - kernelObj string - symbols map[string][]symbolizer.Symbol - ignores []*regexp.Regexp -} - -func ctorAkaros(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol, - ignores []*regexp.Regexp) (Reporter, error) { - ctx := &akaros{ - kernelSrc: kernelSrc, - kernelObj: kernelObj, - symbols: symbols, - ignores: ignores, - } - return ctx, nil -} - -func (ctx *akaros) ContainsCrash(output []byte) bool { - panic("not implemented") -} - -func (ctx *akaros) Parse(output []byte) *Report { - panic("not implemented") -} - -func (ctx *akaros) Symbolize(rep *Report) error { - panic("not implemented") -} diff --git a/pkg/report/fuchsia.go b/pkg/report/fuchsia.go deleted file mode 100644 index 9e75c97b7..000000000 --- a/pkg/report/fuchsia.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2017 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -package report - -import ( - "regexp" - - "github.com/google/syzkaller/pkg/symbolizer" -) - -type fuchsia struct { - kernelSrc string - kernelObj string - symbols map[string][]symbolizer.Symbol - ignores []*regexp.Regexp -} - -func ctorFuchsia(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol, - ignores []*regexp.Regexp) (Reporter, error) { - ctx := &fuchsia{ - kernelSrc: kernelSrc, - kernelObj: kernelObj, - symbols: symbols, - ignores: ignores, - } - return ctx, nil -} - -func (ctx *fuchsia) ContainsCrash(output []byte) bool { - panic("not implemented") -} - -func (ctx *fuchsia) Parse(output []byte) *Report { - panic("not implemented") -} - -func (ctx *fuchsia) Symbolize(rep *Report) error { - panic("not implemented") -} diff --git a/pkg/report/report.go b/pkg/report/report.go index b632bf65e..91f2ab4e7 100644 --- a/pkg/report/report.go +++ b/pkg/report/report.go @@ -67,12 +67,12 @@ func NewReporter(os, kernelSrc, kernelObj string, symbols map[string][]symbolize } var ctors = map[string]fn{ - "akaros": ctorAkaros, + "akaros": ctorStub, "linux": ctorLinux, "freebsd": ctorFreebsd, "netbsd": ctorNetbsd, - "fuchsia": ctorFuchsia, - "windows": ctorWindows, + "fuchsia": ctorStub, + "windows": ctorStub, } type fn func(string, string, map[string][]symbolizer.Symbol, []*regexp.Regexp) (Reporter, error) diff --git a/pkg/report/stub.go b/pkg/report/stub.go new file mode 100644 index 000000000..04f17084a --- /dev/null +++ b/pkg/report/stub.go @@ -0,0 +1,40 @@ +// Copyright 2017 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package report + +import ( + "regexp" + + "github.com/google/syzkaller/pkg/symbolizer" +) + +type stub struct { + kernelSrc string + kernelObj string + symbols map[string][]symbolizer.Symbol + ignores []*regexp.Regexp +} + +func ctorStub(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol, + ignores []*regexp.Regexp) (Reporter, error) { + ctx := &stub{ + kernelSrc: kernelSrc, + kernelObj: kernelObj, + symbols: symbols, + ignores: ignores, + } + return ctx, nil +} + +func (ctx *stub) ContainsCrash(output []byte) bool { + panic("not implemented") +} + +func (ctx *stub) Parse(output []byte) *Report { + panic("not implemented") +} + +func (ctx *stub) Symbolize(rep *Report) error { + panic("not implemented") +} diff --git a/pkg/report/windows.go b/pkg/report/windows.go deleted file mode 100644 index 47573c6a5..000000000 --- a/pkg/report/windows.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2017 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -package report - -import ( - "regexp" - - "github.com/google/syzkaller/pkg/symbolizer" -) - -type windows struct { - kernelSrc string - kernelObj string - symbols map[string][]symbolizer.Symbol - ignores []*regexp.Regexp -} - -func ctorWindows(kernelSrc, kernelObj string, symbols map[string][]symbolizer.Symbol, - ignores []*regexp.Regexp) (Reporter, error) { - ctx := &windows{ - kernelSrc: kernelSrc, - kernelObj: kernelObj, - symbols: symbols, - ignores: ignores, - } - return ctx, nil -} - -func (ctx *windows) ContainsCrash(output []byte) bool { - panic("not implemented") -} - -func (ctx *windows) Parse(output []byte) *Report { - panic("not implemented") -} - -func (ctx *windows) Symbolize(rep *Report) error { - panic("not implemented") -} -- cgit mrf-deployment