RE: [PATCH v3 4/8] Add record_start function.

Metzger, Markus T
2016-11-29T15:47:45Z

> -----Original Message-----
> From: Wiederhake, Tim
> Sent: Monday, November 21, 2016 4:49 PM
> To: gdb-patches@sourceware.org
> Cc: palves@redhat.com; Metzger, Markus T <markus.t.metzger@intel.com>
> Subject: [PATCH v3 4/8] Add record_start function.
>
> 2016-11-21 Tim Wiederhake <tim.wiederhake@intel.com>
>
> gdb/ChangeLog
>
> * record.h (record_start): New export.
> * record.c (record_start): New function.

> +void
> +record_start (const char *method, const char *format, int from_tty)
> +{
> + if (method == NULL)
> + {
> + if (format == NULL)
> + return execute_command ("record", from_tty);
> + }
> + else if (strcmp (method, "full") == 0)
> + {
> + if (format == NULL)
> + return execute_command ("record full", from_tty);
> + }
> + else if (strcmp (method, "btrace") == 0)
> + {
> + if (format == NULL)
> + return execute_command ("record btrace", from_tty);
> + if (strcmp (format, "bts") == 0)
> + return execute_command ("record btrace bts", from_tty);
> + if (strcmp (format, "pt") == 0)
> + return execute_command ("record btrace pt", from_tty);
> + }
> +
> + error (_("Invalid argument."));

Should we split this into "Invalid recording method" and "Invalid
recording format"?

> +/* Internal function that starts recording with the given METHOD and FORMAT.
> + NULL means default method or format. */

What does 'internal' mean in this context?

> +extern void record_start (const char *method, const char *format,
> + int from_tty);
> +
> #endif /* _RECORD_H_ */
> --
> 2.7.4

thanks,
Markus.

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928