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

Method GetStackTrace

user/event/event_context.go:251–276  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

249}
250
251func (this *ContextEvent) GetStackTrace(s string) string {
252 if this.mconf.RegName != "" {
253 reg_info := []string{}
254 for _, reg_name := range strings.Split(this.mconf.RegName, ",") {
255 reg_value := this.GetRegValue(reg_name)
256 info, err := util.ParseReg(this.Pid, reg_value)
257 if err != nil {
258 fmt.Printf("ParseReg for %s=0x%x failed", reg_name, reg_value)
259 } else {
260 reg_info = append(reg_info, fmt.Sprintf("%s(0x%x %s)", reg_name, reg_value, info))
261 }
262 }
263 s += fmt.Sprintf(", RegsInfo:\n%s", strings.Join(reg_info, "\n"))
264 }
265 if this.mconf.ShowRegs {
266 s += ", Regs:\n" + this.GetRegsString()
267 }
268 if this.Stackinfo != "" {
269 if this.mconf.ShowRegs {
270 s += fmt.Sprintf("\nBacktrace:\n%s", this.Stackinfo)
271 } else {
272 s += fmt.Sprintf(", Backtrace:\n%s", this.Stackinfo)
273 }
274 }
275 return s
276}
277
278func (this *ContextEvent) GetOpt() *UnwindOption {
279 opt := &UnwindOption{}

Callers 3

StringMethod · 0.80
StringMethod · 0.80
StringMethod · 0.80

Calls 3

GetRegValueMethod · 0.95
GetRegsStringMethod · 0.95
ParseRegFunction · 0.92

Tested by

no test coverage detected