daily update
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index 6b9faf33e0c1d74eb15b1ddcb8fc86daa6b681fa..e38c54aad774b9d8bfe4f26042fc95032561de8e 100644 (file)
@@ -9115,8 +9115,6 @@ static void
 parse_breakpoint_sals (char **address,
                       struct linespec_result *canonical)
 {
-  char *addr_start = *address;
-
   /* If no arg given, or if first arg is 'if ', use the default
      breakpoint.  */
   if ((*address) == NULL
@@ -9231,6 +9229,14 @@ check_fast_tracepoint_sals (struct gdbarch *gdbarch,
     }
 }
 
+/* Issue an invalid thread ID error.  */
+
+static void ATTRIBUTE_NORETURN
+invalid_thread_id_error (int id)
+{
+  error (_("Unknown thread %d."), id);
+}
+
 /* Given TOK, a string specification of condition and thread, as
    accepted by the 'break' command, extract the condition
    string and thread number and set *COND_STRING and *THREAD.
@@ -9245,6 +9251,9 @@ find_condition_and_thread (char *tok, CORE_ADDR pc,
 {
   *cond_string = NULL;
   *thread = -1;
+  *task = 0;
+  *rest = NULL;
+
   while (tok && *tok)
     {
       char *end_tok;
@@ -9284,7 +9293,7 @@ find_condition_and_thread (char *tok, CORE_ADDR pc,
          if (tok == tmptok)
            error (_("Junk after thread keyword."));
          if (!valid_thread_id (*thread))
-           error (_("Unknown thread %d."), *thread);
+           invalid_thread_id_error (*thread);
        }
       else if (toklen >= 1 && strncmp (tok, "task", toklen) == 0)
        {
@@ -9495,9 +9504,7 @@ create_breakpoint (struct gdbarch *gdbarch,
                from thread number, so parsing in context of first
                sal is OK.  When setting the breakpoint we'll 
                re-parse it in context of each sal.  */
-            cond_string = NULL;
-            thread = -1;
-           rest = NULL;
+
             find_condition_and_thread (arg, lsal->sals.sals[0].pc, &cond_string,
                                        &thread, &task, &rest);
             if (cond_string)
@@ -9548,7 +9555,18 @@ create_breakpoint (struct gdbarch *gdbarch,
       init_raw_breakpoint_without_location (b, gdbarch, type_wanted, ops);
 
       b->addr_string = copy_arg;
-      b->cond_string = NULL;
+      if (parse_condition_and_thread)
+       b->cond_string = NULL;
+      else
+       {
+         /* Create a private copy of condition string.  */
+         if (cond_string)
+           {
+             cond_string = xstrdup (cond_string);
+             make_cleanup (xfree, cond_string);
+           }
+         b->cond_string = cond_string;
+       }
       b->extra_string = NULL;
       b->ignore_count = ignore_count;
       b->disposition = tempflag ? disp_del : disp_donttouch;
@@ -10153,6 +10171,8 @@ watchpoint_exp_is_const (const struct expression *exp)
        case OP_BITSTRING:
        case OP_ARRAY:
        case OP_TYPE:
+       case OP_TYPEOF:
+       case OP_DECLTYPE:
        case OP_NAME:
        case OP_OBJC_NSSTRING:
 
@@ -10162,6 +10182,10 @@ watchpoint_exp_is_const (const struct expression *exp)
        case UNOP_ADDR:
        case UNOP_HIGH:
        case UNOP_CAST:
+
+       case UNOP_CAST_TYPE:
+       case UNOP_REINTERPRET_CAST:
+       case UNOP_DYNAMIC_CAST:
          /* Unary, binary and ternary operators: We have to check
             their operands.  If they are constant, then so is the
             result of that operation.  For instance, if A and B are
@@ -10763,7 +10787,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty,
 
              /* Check if the thread actually exists.  */
              if (!valid_thread_id (thread))
-               error (_("Unknown thread %d."), thread);
+               invalid_thread_id_error (thread);
            }
          else if (toklen == 4 && !strncmp (tok, "mask", 4))
            {
@@ -14009,10 +14033,8 @@ addr_string_to_sals (struct breakpoint *b, char *addr_string, int *found)
        resolve_sal_pc (&sals.sals[i]);
       if (b->condition_not_parsed && s && s[0])
        {
-         char *cond_string = 0;
-         int thread = -1;
-         int task = 0;
-         char *extra_string = NULL;
+         char *cond_string, *extra_string;
+         int thread, task;
 
          find_condition_and_thread (s, sals.sals[0].pc,
                                     &cond_string, &thread, &task,
@@ -15837,6 +15859,10 @@ initialize_breakpoint_ops (void)
   ops->print_recreate = bkpt_print_recreate;
 }
 
+/* Chain containing all defined "enable breakpoint" subcommands.  */
+
+static struct cmd_list_element *enablebreaklist = NULL;
+
 void
 _initialize_breakpoint (void)
 {
This page took 0.029009 seconds and 4 git commands to generate.