[commit] Minor reformatting of breakpoint.c

Joel Brobecker brobecker@adacore.com
Sat Apr 26 12:16:00 GMT 2008


I noticed while reading some code a while back that a couple of curly
brace were at the wrong spot, and told myself that I'd fix them when
I have a moment. Here it is.

While I was at it, I noticed that the indentation level of a block
inside condition_command was off, so I ran the procedure through
gdb_indent.sh (double-checking the result to make sure it didn't
get worse).

2008-04-26  Joel Brobecker  <brobecker@adacore.com>

        * breakpoint.c (condition_command, commands_from_control_command)
        (break_command_really): Minor reformatting.

Tested on x86-linux. Checked in.

-- 
Joel
-------------- next part --------------
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.315
diff -u -p -r1.315 breakpoint.c
--- breakpoint.c	25 Apr 2008 14:50:10 -0000	1.315
+++ breakpoint.c	26 Apr 2008 05:43:06 -0000
@@ -601,44 +601,45 @@ condition_command (char *arg, int from_t
 
   ALL_BREAKPOINTS (b)
     if (b->number == bnum)
-    {
-      struct bp_location *loc = b->loc;
-      for (; loc; loc = loc->next)
-	{
-	  if (loc->cond)
-	    {
-	      xfree (loc->cond);
-	      loc->cond = 0;
-	    }
-	}
-      if (b->cond_string != NULL)
-	xfree (b->cond_string);
+      {
+	struct bp_location *loc = b->loc;
+	for (; loc; loc = loc->next)
+	  {
+	    if (loc->cond)
+	      {
+		xfree (loc->cond);
+		loc->cond = 0;
+	      }
+	  }
+	if (b->cond_string != NULL)
+	  xfree (b->cond_string);
 
-      if (*p == 0)
-	{
-	  b->cond_string = NULL;
-	  if (from_tty)
-	    printf_filtered (_("Breakpoint %d now unconditional.\n"), bnum);
-	}
-      else
-	{
-	  arg = p;
-	  /* I don't know if it matters whether this is the string the user
-	     typed in or the decompiled expression.  */
-	  b->cond_string = savestring (arg, strlen (arg));
-	  b->condition_not_parsed = 0;
-	  for (loc = b->loc; loc; loc = loc->next)
-	    {
-	      arg = p;
-	      loc->cond = parse_exp_1 (&arg, block_for_pc (loc->address), 0);
-	      if (*arg)
-		error (_("Junk at end of expression"));
-	    }
-	}
-      breakpoints_changed ();
-      breakpoint_modify_event (b->number);
-      return;
-    }
+	if (*p == 0)
+	  {
+	    b->cond_string = NULL;
+	    if (from_tty)
+	      printf_filtered (_("Breakpoint %d now unconditional.\n"), bnum);
+	  }
+	else
+	  {
+	    arg = p;
+	    /* I don't know if it matters whether this is the string the user
+	       typed in or the decompiled expression.  */
+	    b->cond_string = savestring (arg, strlen (arg));
+	    b->condition_not_parsed = 0;
+	    for (loc = b->loc; loc; loc = loc->next)
+	      {
+		arg = p;
+		loc->cond =
+		  parse_exp_1 (&arg, block_for_pc (loc->address), 0);
+		if (*arg)
+		  error (_("Junk at end of expression"));
+	      }
+	  }
+	breakpoints_changed ();
+	breakpoint_modify_event (b->number);
+	return;
+      }
 
   error (_("No breakpoint number %d."), bnum);
 }
@@ -723,7 +724,7 @@ commands_from_control_command (char *arg
 	breakpoints_changed ();
 	breakpoint_modify_event (b->number);
 	return simple_control;
-    }
+      }
   error (_("No breakpoint number %d."), bnum);
 }
 
@@ -5565,7 +5566,7 @@ break_command_really (char *arg, char *c
      breakpoint. */
   if (!pending)
     {
-        if (parse_condition_and_thread)
+      if (parse_condition_and_thread)
         {
             /* Here we only parse 'arg' to separate condition
                from thread number, so parsing in context of first
@@ -5577,7 +5578,7 @@ break_command_really (char *arg, char *c
             if (cond_string)
                 make_cleanup (xfree, cond_string);
         }
-        else
+      else
         {
             /* Create a private copy of condition string.  */
             if (cond_string)


More information about the Gdb-patches mailing list