gdb/
authorYao Qi <yao@codesourcery.com>
Fri, 11 Jan 2013 00:41:08 +0000 (00:41 +0000)
committerYao Qi <yao@codesourcery.com>
Fri, 11 Jan 2013 00:41:08 +0000 (00:41 +0000)
* breakpoint.c (print_one_breakpoint_location): Remove dead code.
(update_dprintf_command_list): Assert that 'printf_line' is
non-null.  Remove condition check.

gdb/ChangeLog
gdb/breakpoint.c

index 6f4ad13..65cbabc 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-11  Yao Qi  <yao@codesourcery.com>
+
+       * breakpoint.c (print_one_breakpoint_location): Remove dead code.
+       (update_dprintf_command_list): Assert that 'printf_line' is
+       non-null.  Remove condition check.
+
 2013-01-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Code cleanup.
index e56d9df..4d76fa1 100644 (file)
@@ -6094,15 +6094,6 @@ print_one_breakpoint_location (struct breakpoint *b,
          ui_out_text (uiout, " bytes\n");
        }
     }
-  
-  if (!part_of_multiple && b->extra_string
-      && b->type == bp_dprintf && !b->commands)
-    {
-      annotate_field (7);
-      ui_out_text (uiout, "\t(agent printf) ");
-      ui_out_field_string (uiout, "printf", b->extra_string);
-      ui_out_text (uiout, "\n");
-    }
 
   l = b->commands ? b->commands->commands : NULL;
   if (!part_of_multiple && l)
@@ -8894,30 +8885,30 @@ update_dprintf_command_list (struct breakpoint *b)
     internal_error (__FILE__, __LINE__,
                    _("Invalid dprintf style."));
 
+  gdb_assert (printf_line != NULL);
   /* Manufacture a printf/continue sequence.  */
-  if (printf_line)
-    {
-      struct command_line *printf_cmd_line, *cont_cmd_line = NULL;
+  {
+    struct command_line *printf_cmd_line, *cont_cmd_line = NULL;
 
-      if (strcmp (dprintf_style, dprintf_style_agent) != 0)
-       {
-         cont_cmd_line = xmalloc (sizeof (struct command_line));
-         cont_cmd_line->control_type = simple_control;
-         cont_cmd_line->body_count = 0;
-         cont_cmd_line->body_list = NULL;
-         cont_cmd_line->next = NULL;
-         cont_cmd_line->line = xstrdup ("continue");
-       }
+    if (strcmp (dprintf_style, dprintf_style_agent) != 0)
+      {
+       cont_cmd_line = xmalloc (sizeof (struct command_line));
+       cont_cmd_line->control_type = simple_control;
+       cont_cmd_line->body_count = 0;
+       cont_cmd_line->body_list = NULL;
+       cont_cmd_line->next = NULL;
+       cont_cmd_line->line = xstrdup ("continue");
+      }
 
-      printf_cmd_line = xmalloc (sizeof (struct command_line));
-      printf_cmd_line->control_type = simple_control;
-      printf_cmd_line->body_count = 0;
-      printf_cmd_line->body_list = NULL;
-      printf_cmd_line->next = cont_cmd_line;
-      printf_cmd_line->line = printf_line;
+    printf_cmd_line = xmalloc (sizeof (struct command_line));
+    printf_cmd_line->control_type = simple_control;
+    printf_cmd_line->body_count = 0;
+    printf_cmd_line->body_list = NULL;
+    printf_cmd_line->next = cont_cmd_line;
+    printf_cmd_line->line = printf_line;
 
-      breakpoint_set_commands (b, printf_cmd_line);
-    }
+    breakpoint_set_commands (b, printf_cmd_line);
+  }
 }
 
 /* Update all dprintf commands, making their command lists reflect