File tree 4 files changed +34
-0
lines changed
4 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ var Decoders = []Decoder{
36
36
new (CIDRDecoder ),
37
37
new (StaticConfigDecoder ),
38
38
new (UnitDecoder ),
39
+ new (DemangleDecoder ),
39
40
}
40
41
41
42
type Decoder interface {
Original file line number Diff line number Diff line change
1
+ package decoder
2
+
3
+ import (
4
+ "strings"
5
+
6
+ "github.com/ianlancetaylor/demangle"
7
+ )
8
+
9
+ type DemangleDecoder struct {
10
+ }
11
+
12
+ func (h DemangleDecoder ) Sniffer (text string ) Possibility {
13
+ return MayBe
14
+ }
15
+
16
+ func (h DemangleDecoder ) Decode (text string ) (interface {}, bool ) {
17
+ output , err := demangle .ToString (strings .TrimSpace (text ))
18
+ if err != nil {
19
+ return nil , false
20
+ }
21
+
22
+ return & DecodeResult {
23
+ DecoderName : "C++/Rust Symbol Demangle" ,
24
+ Result : output ,
25
+ }, true
26
+ }
27
+
28
+ func (h DemangleDecoder ) Encode (text string ) (interface {}, bool ) {
29
+ return nil , false
30
+ }
Original file line number Diff line number Diff line change 5
5
require gopkg.in/yaml.v3 v3.0.1
6
6
7
7
require (
8
+ github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab // indirect
8
9
github.com/samber/lo v1.21.0 // indirect
9
10
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
10
11
)
Original file line number Diff line number Diff line change
1
+ github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab h1:BA4a7pe6ZTd9F8kXETBoijjFJ/ntaa//1wiH9BZu4zU =
2
+ github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab /go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw =
1
3
github.com/samber/lo v1.21.0 h1:FSby8pJQtX4KmyddTCCGhc3JvnnIVrDA+NW37rG+7G8 =
2
4
github.com/samber/lo v1.21.0 /go.mod h1:2I7tgIv8Q1SG2xEIkRq0F2i2zgxVpnyPOP0d3Gj2r+A =
3
5
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM =
You can’t perform that action at this time.
0 commit comments