Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Pending breakpoints in MI
Date: Thu, 13 Dec 2007 14:44:00 -0000	[thread overview]
Message-ID: <20071213135259.GA10040@adacore.com> (raw)
In-Reply-To: <200711081412.14452.ghost@cs.msu.su>

Volodya,

You forgot to provide a ChangeLog...

Here are my comments on your patch itself. It's mostly fine so we should
be able to check it in soon :).

>  gdb_breakpoint (char *address, char *condition,
>  		int hardwareflag, int tempflag,
>  		int thread, int ignore_count,
> +                int pending,
>  		char **error_message)

I can't believe I'm saying this, since I absolutely hate tabs, but
these are the coding rules: You need to use a tab instead of 8 spaces
in the line above. Compare for instance how the "char **error_message"
line is indented.

> -                                 AUTO_BOOLEAN_FALSE /* no pending. */,
> +                                 pending 
> +                                 ? AUTO_BOOLEAN_TRUE : AUTO_BOOLEAN_FALSE,

Same here.

>  			    int thread, int ignore_count,
> +                            int pending,
>  			    char **error_message);

Likewise in the .h prototype.

> --- gdb/testsuite/gdb.mi/mi-pending.exp	(/patches/pending_mi_2_code_duplication)	(revision 45)
> +++ gdb/testsuite/gdb.mi/mi-pending.exp	(/patches/pending_mi_3_breakpoints)	(revision 45)
> @@ -0,0 +1,75 @@
> +# Copyright 2003, 2004, 2005, 2007 Free Software Foundation, Inc.

Shouldn't the copyright year be only 2007?

> --- gdb/testsuite/gdb.mi/mi-pending.c	(/patches/pending_mi_2_code_duplication)	(revision 45)
> +++ gdb/testsuite/gdb.mi/mi-pending.c	(/patches/pending_mi_3_breakpoints)	(revision 45)
> @@ -0,0 +1,34 @@
> +/* This testcase is part of GDB, the GNU debugger.
> +
> +   Copyright 2004, 2007 Free Software Foundation, Inc.

Same question here.

> --- gdb/testsuite/gdb.mi/mi-pendshr.c	(/patches/pending_mi_2_code_duplication)	(revision 45)
> +++ gdb/testsuite/gdb.mi/mi-pendshr.c	(/patches/pending_mi_3_breakpoints)	(revision 45)
> @@ -0,0 +1,32 @@
> +/* This testcase is part of GDB, the GNU debugger.
> +
> +   Copyright 2004, 2007 Free Software Foundation, Inc.

Likewise here...

> --- gdb/mi/mi-cmd-break.c	(/patches/pending_mi_2_code_duplication)	(revision 45)
> +++ gdb/mi/mi-cmd-break.c	(/patches/pending_mi_3_breakpoints)	(revision 45)
> @@ -63,7 +63,10 @@ enum bp_type
>     breakpoint.  -break-insert -t -h <location> --> insert a temporary
>     hw bp.  
>     -break-insert -r <regexp> --> insert a bp at functions matching
> -   <regexp> */
> +   <regexp> 
> +
> +   The -f flag makes GDB create a pending breakpoint if no
> +   locations for breakpoint are found now.  */

Actually, I think that the entire comment needs to be rewritten
in a way that the syntax is not described there at all. Just say
that this function implements the -break-insert command which, as
its name suggests, inserts a breakpoint.  The syntax needs to be
documented in the GDB manual. See
http://www.sourceware.org/gdb/current/onlinedocs/gdb_25.html#SEC259
for what is currently documented. Let's use this opportunity to
make sure that every option (and only the supported options) are
documented.

> @@ -122,6 +127,9 @@ mi_cmd_break_insert (char *command, char
>  	case THREAD_OPT:
>  	  thread = atol (optarg);
>  	  break;
> +        case PENDING_OPT:
> +          pending = 1;
> +          break;

The indentation is strange, could you double-check it?

> @@ -139,12 +147,14 @@ mi_cmd_break_insert (char *command, char
>        rc = gdb_breakpoint (address, condition,
>  			   0 /*hardwareflag */ , temp_p,
>  			   thread, ignore_count,
> +                           pending,
>  			   &mi_error_message);
>        break;
>      case HW_BP:
>        rc = gdb_breakpoint (address, condition,
>  			   1 /*hardwareflag */ , temp_p,
>  			   thread, ignore_count,
> +                           pending,

I think you need to replace some spaces with tabs here too...

Thanks,
-- 
Joel


  parent reply	other threads:[~2007-12-13 13:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08 11:12 Vladimir Prus
2007-11-19 20:42 ` Vladimir Prus
2007-11-26 18:03   ` Vladimir Prus
2007-12-05 14:40     ` Vladimir Prus
2007-12-12 19:21       ` Vladimir Prus
2007-12-13 14:44 ` Joel Brobecker [this message]
2007-12-13 16:03   ` Vladimir Prus
2007-12-13 16:12     ` Joel Brobecker
2007-12-14  0:11     ` Eli Zaretskii
2007-12-14  6:27       ` Vladimir Prus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071213135259.GA10040@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox