2 * Copyright (C) 2017-2018 "IoT.bzh"
3 * Author Sebastien Douheret <sebastien@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 // ExecArgs JSON parameters of /exec command
23 ID string `json:"id" binding:"required"`
24 SdkID string `json:"sdkID"` // sdk ID to use for setting env
25 CmdID string `json:"cmdID"` // command unique ID
26 Cmd string `json:"cmd" binding:"required"`
27 Args []string `json:"args"`
28 Env []string `json:"env"`
29 RPath string `json:"rpath"` // relative path into project
30 TTY bool `json:"tty"` // Use a tty, specific to gdb --tty option
31 TTYGdbserverFix bool `json:"ttyGdbserverFix"` // Set to true to activate gdbserver workaround about inferior output
32 ExitImmediate bool `json:"exitImmediate"` // when true, exit event sent immediately when command exited (IOW, don't wait file synchronization)
33 CmdTimeout int `json:"timeout"` // command completion timeout in Second
36 // ExecResult JSON result of /exec command
38 Status string `json:"status"` // status OK
39 CmdID string `json:"cmdID"` // command unique ID
42 // ExecSigResult JSON result of /signal command
43 ExecSigResult struct {
44 Status string `json:"status"` // status OK
45 CmdID string `json:"cmdID"` // command unique ID
48 // ExecInMsg Message used to received input characters (stdin)
50 CmdID string `json:"cmdID"`
51 Timestamp string `json:"timestamp"`
52 Stdin string `json:"stdin"`
55 // ExecOutMsg Message used to send output characters (stdout+stderr)
57 CmdID string `json:"cmdID"`
58 Timestamp string `json:"timestamp"`
59 Stdout string `json:"stdout"`
60 Stderr string `json:"stderr"`
63 // ExecExitMsg Message sent when executed command exited
65 CmdID string `json:"cmdID"`
66 Timestamp string `json:"timestamp"`
67 Code int `json:"code"`
68 Error error `json:"error"`
71 // ExecSignalArgs JSON parameters of /exec/signal command
72 ExecSignalArgs struct {
73 CmdID string `json:"cmdID" binding:"required"` // command id
74 Signal string `json:"signal" binding:"required"` // signal number
79 // ExecInEvent Event send in WS when characters are sent (stdin)
80 ExecInEvent = "exec:input"
82 // ExecOutEvent Event send in WS when characters are received (stdout or stderr)
83 ExecOutEvent = "exec:output"
85 // ExecExitEvent Event send in WS when program exited
86 ExecExitEvent = "exec:exit"
88 // ExecInferiorInEvent Event send in WS when characters are sent to an inferior (used by gdb inferior/tty)
89 ExecInferiorInEvent = "exec:inferior-input"
91 // ExecInferiorOutEvent Event send in WS when characters are received by an inferior
92 ExecInferiorOutEvent = "exec:inferior-output"