Don't repeat breakpoint commands

Message ID 1417798543-24712-1-git-send-email-andreas.from@ericsson.com
State New, archived
Headers

Commit Message

Andreas From Dec. 5, 2014, 4:55 p.m. UTC
  There's no real use case for repeatedly adding the same breakpoint.

gdb/ChangeLog:

	* breakpoint.c (break_command_1): Add dont_repeat call.
---
 gdb/breakpoint.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Joel Brobecker Dec. 6, 2014, 3:12 a.m. UTC | #1
On Fri, Dec 05, 2014 at 11:55:43AM -0500, Andreas From wrote:
> There's no real use case for repeatedly adding the same breakpoint.
> 
> gdb/ChangeLog:
> 
> 	* breakpoint.c (break_command_1): Add dont_repeat call.

I would agree, but since this is a slight change of behavior (albeit
a natural one), let's give others another week to comment if they
would like to.

The patch looks good to me; if there are no objections by then,
let's push.

Thank you!

> ---
>  gdb/breakpoint.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
> index 574d06c..f0eede0 100644
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -10177,6 +10177,8 @@ break_command_1 (char *arg, int flag, int from_tty)
>    struct breakpoint_ops *ops;
>    const char *arg_cp = arg;
>  
> +  dont_repeat ();
> +
>    /* Matching breakpoints on probes.  */
>    if (arg && probe_linespec_to_ops (&arg_cp) != NULL)
>      ops = &bkpt_probe_breakpoint_ops;
> -- 
> 1.9.1
  

Patch

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 574d06c..f0eede0 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10177,6 +10177,8 @@  break_command_1 (char *arg, int flag, int from_tty)
   struct breakpoint_ops *ops;
   const char *arg_cp = arg;
 
+  dont_repeat ();
+
   /* Matching breakpoints on probes.  */
   if (arg && probe_linespec_to_ops (&arg_cp) != NULL)
     ops = &bkpt_probe_breakpoint_ops;