MCPcopy Create free account
hub / github.com/SeeFlowerX/stackplz / InitCommonConfig

Method InitCommonConfig

user/config/config_module.go:831–873  ·  view source on GitHub ↗
(gconfig *GlobalConfig)

Source from the content-addressed store, hash-verified

829}
830
831func (this *ModuleConfig) InitCommonConfig(gconfig *GlobalConfig) {
832
833 this.MaxOp = gconfig.MaxOp
834 this.Buffer = gconfig.Buffer
835 this.UnwindStack = gconfig.UnwindStack
836 this.ManualStack = gconfig.ManualStack
837 if gconfig.StackSize&7 != 0 {
838 panic(fmt.Sprintf("dump stack size %d is not 8-byte aligned.", gconfig.StackSize))
839 }
840 this.StackSize = gconfig.StackSize
841 this.ShowRegs = gconfig.ShowRegs
842 this.GetOff = gconfig.GetOff
843 this.Debug = gconfig.Debug
844 switch gconfig.TragetArch {
845 case "aarch64":
846 this.Is32Bit = false
847 case "arm", "aarch32":
848 this.Is32Bit = true
849 default:
850 panic(fmt.Sprintf("arch %s not supported", gconfig.TragetArch))
851 }
852 this.Color = gconfig.Color
853 this.FmtJson = gconfig.FmtJson
854 this.RegName = gconfig.RegName
855 this.DumpHex = gconfig.DumpHex
856 this.ShowPC = gconfig.ShowPC
857 this.ShowTime = gconfig.ShowTime
858 this.ShowUid = gconfig.ShowUid
859
860 this.AutoResume = gconfig.AutoResume
861 this.KillSignal = util.ParseSignal(gconfig.KillSignal)
862 this.TKillSignal = util.ParseSignal(gconfig.TKillSignal)
863
864 this.StackUprobeConf = &StackUprobeConfig{}
865 this.StackUprobeConf.SetDumpHex(this.DumpHex)
866 this.StackUprobeConf.SetColor(this.Color)
867
868 this.SysCallConf = &SyscallConfig{}
869 this.SysCallConf.SetDebug(this.Debug)
870 this.SysCallConf.SetLogger(this.logger)
871 this.SysCallConf.SetDumpHex(this.DumpHex)
872 this.SysCallConf.SetColor(this.Color)
873}
874
875func (this *ModuleConfig) LoadConfig(gconfig *GlobalConfig) {
876

Callers 1

persistentPreRunEFuncFunction · 0.80

Calls 5

ParseSignalFunction · 0.92
SetDumpHexMethod · 0.65
SetColorMethod · 0.65
SetDebugMethod · 0.65
SetLoggerMethod · 0.65

Tested by

no test coverage detected