func parse(raw []byte, cmd string) crash.Info { // this just prettifies the rest of the parsers slightly die := func() { explode(raw, cmd) } ci := crash.Info{} ci.Registers = parseRegisters(raw, die) parseStack(raw, &ci, die) parseExploitable(raw, &ci, die) ci.FaultingInsn, ci.Disassembly = parseDisasm(raw, die) parseIndicators(raw, &ci, die) return ci }
func parse(raw []byte, cmd string) crash.Info { // This is "inefficient", but I'm going to parse each thing I'm interested // in out of the full output instead of doing a single pass. // this just prettifies the rest of the parsers slightly die := func() { explode(raw, cmd) } ci := crash.Info{} ci.Registers = parseRegisters(raw, die) ci.Stack = parseStack(raw, die) parseExploitable(raw, &ci, die) // easier for this one to modify ci directly ci.FaultingInsn, ci.Disassembly = parseDisasm(raw, die) return ci }