This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] add -s option to make -break-insert support dprintf


Hi Tom,

Thanks for your review.

On Fri, May 10, 2013 at 11:21 PM, Tom Tromey <tromey@redhat.com> wrote:
> Hui> +    if (isprint(argv[0][i]))
>
> Missing space before "(".

Fixed.

>
> Hui> +        char tmp[5];
> Hui> +        sprintf (tmp, "\\%o", (unsigned char)argv[0][i]);
>
> Missing newline between these lines.
> Missing space after ")".

Fixed.

>
> Hui> +  if (dprintf)
> Hui> +    {
> Hui> +      int format_num = oind + 1;
> Hui> +
> Hui> +      if (hardware || tracepoint)
> Hui> +  error (_("-dprintf-insert: does not support -h or -a"));
> Hui> +      if (format_num >= argc)
> Hui> +  error (_("-dprintf-insert: Missing <format>"));
> Hui> +
> Hui> +      extra_string = mi_argv_to_format (argv + format_num, argc - format_num);
> Hui> +      extra_string_cleanup = make_cleanup (xfree, extra_string);
>
> It is better to just install an outer null cleanup and invoke that at
> the end.

Fixed.

The attachments is the new version of patches.

Thanks,
Hui

2013-05-11  Hui Zhu  <hui@codesourcery.com>

	* breakpoint.c (dprintf_breakpoint_ops): Remove its static.
	* breakpoint.h (dprintf_breakpoint_ops): Add extern.
	* mi/mi-cmd-break.c (ctype.h): New include.
	(gdb_obstack.h): New include.
	(mi_argv_to_format, mi_cmd_break_insert_1): New.
	(mi_cmd_break_insert): Call mi_cmd_break_insert_1.
	(mi_cmd_dprintf_insert): New.
	* mi/mi-cmds.c (mi_cmds): Add "dprintf-insert".
	* mi/mi-cmds.h (mi_cmd_dprintf_insert): New extern.

2013-05-11  Hui Zhu  <hui@codesourcery.com>

	* gdb.texinfo (GDB/MI Breakpoint Commands): Describe the
	"-dprintf-insert" command.

2013-05-11  Hui Zhu  <hui@codesourcery.com>

	* gdb.mi/Makefile.in (PROGS): Add "mi-dprintf".
	* gdb.mi/mi-dprintf.exp, gdb.mi/mi-dprintf.c: New.

Attachment: mi-dprintf.txt
Description: Text document

Attachment: mi-dprintf-doc.txt
Description: Text document

Attachment: mi-dprintf-test.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]