Esempio n. 1
0
func eventMessage(ev *gdbmi.GDBEvent, fs map[string]filesystem.WorkspaceFS) message {
	jev := gdbjsonevent{*ev, ev.Type.String(), ev.StopReason.String(), nil, nil}
	if ev.CurrentStackFrame != nil {
		fs, rel, err := filesystem.FindFilesystem(ev.CurrentStackFrame.Fullname, fs)
		if err == nil {
			fsn := fs.Name()
			jev.Filesystem = &fsn
			jev.Path = &rel
		}
	}
	return message{ev_async, &jev, nil}
}
Esempio n. 2
0
func patchFrameSourceLocations(frames *[]gdbmi.StackFrame, fs map[string]filesystem.WorkspaceFS) *[]stackframe {
	res := make([]stackframe, len(*frames))
	for i, fa := range *frames {
		fs, rel, err := filesystem.FindFilesystem(fa.File, fs)
		if err == nil {
			res[i].StackFrame = fa
			res[i].Filesystem = fs.Name()
			res[i].Path = rel
		}
	}
	return &res
}