This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] dynamic printf
>>>>> "Stan" == Stan Shebs <stanshebs@earthlink.net> writes:
Sorry about the delay on this.
Stan> + /* Manufacture a printf/continue sequence. */
Stan> + if (printf_line)
Stan> + {
Stan> + struct command_line *printf_cmd_line, *cont_cmd_line = NULL;
Stan> +
Stan> + cont_cmd_line = xmalloc (sizeof (struct command_line));
Stan> + cont_cmd_line->control_type = simple_control;
Stan> + cont_cmd_line->body_count = 0;
Stan> + cont_cmd_line->body_list = NULL;
Stan> + cont_cmd_line->next = NULL;
Stan> + cont_cmd_line->line = xstrdup ("continue");
Stan> +
Stan> + printf_cmd_line = xmalloc (sizeof (struct command_line));
Stan> + printf_cmd_line->control_type = simple_control;
Stan> + printf_cmd_line->body_count = 0;
Stan> + printf_cmd_line->body_list = NULL;
Stan> + printf_cmd_line->next = cont_cmd_line;
Stan> + printf_cmd_line->line = printf_line;
Stan> +
Stan> + breakpoint_set_commands (b, printf_cmd_line);
I thought this approach would break "next"ing over a dprintf location.
Stan> +void dprintf_command (char *arg, int from_tty);
Stan> +
Stan> +/* The dynamic printf command is mostly like a regular breakpoint, but
Stan> + with a prewired command list consisting of a single output command,
Stan> + built from extra arguments supplied on the dprintf command
Stan> + line. */
Stan> +
Stan> +void
Stan> +dprintf_command (char *arg, int from_tty)
I think this could be static.
Tom