Use watchpoint's language when re-parsing expression
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index 9d6a2f4eb8de6ac1fae06b443481cb08253dced4..150b08ca9d44aecc09783e349a4acf42ef920ef7 100644 (file)
@@ -11256,18 +11256,11 @@ watch_command_1 (const char *arg, int accessflag, int from_tty,
       struct type *t = value_type (val);
       CORE_ADDR addr = value_as_address (val);
 
-      t = check_typedef (TYPE_TARGET_TYPE (check_typedef (t)));
-
-      std::string name = type_to_string (t);
-
-      w->exp_string_reparse = xstrprintf ("* (%s *) %s", name.c_str (),
-                                         core_addr_to_string (addr));
+      w->exp_string_reparse
+       = current_language->la_watch_location_expression (t, addr).release ();
 
       w->exp_string = xstrprintf ("-location %.*s",
                                  (int) (exp_end - exp_start), exp_start);
-
-      /* The above expression is in C.  */
-      b->language = language_c;
     }
   else
     w->exp_string = savestring (exp_start, exp_end - exp_start);
This page took 0.038861 seconds and 4 git commands to generate.