proc/gdbserial: mozilla rr support (#804)

Implements #727
This commit is contained in:
Alessandro Arzilli
2017-05-06 00:17:52 +02:00
committed by Derek Parker
parent 1f1535802e
commit a843f7944e
37 changed files with 1843 additions and 138 deletions

View File

@ -98,7 +98,9 @@ func New() *cobra.Command {
RootCommand.PersistentFlags().StringVar(&Backend, "backend", "default", `Backend selection:
default Uses lldb on macOS, native everywhere else.
native Native backend.
lldb Uses lldb-server or debugserver.`)
lldb Uses lldb-server or debugserver.
rr Uses mozilla rr (https://github.com/mozilla/rr).
`)
// 'attach' subcommand.
attachCommand := &cobra.Command{
@ -240,6 +242,29 @@ core dump was taken.`,
}
RootCommand.AddCommand(versionCommand)
if path, _ := exec.LookPath("rr"); path != "" {
replayCommand := &cobra.Command{
Use: "replay [trace directory]",
Short: "Replays a rr trace.",
Long: `Replays a rr trace.
The replay command will open a trace generated by mozilla rr. Mozilla rr must be installed:
https://github.com/mozilla/rr
`,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return errors.New("you must provide a path to a binary")
}
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Backend = "rr"
os.Exit(execute(0, []string{}, conf, args[0], executingOther))
},
}
RootCommand.AddCommand(replayCommand)
}
return RootCommand
}