gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 3 Mar 2012 14:21:04 +0000 (14:21 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 3 Mar 2012 14:21:04 +0000 (14:21 +0000)
* breakpoint.c (set_condition_evaluation_mode): Set
CONDITION_EVALUATION_MODE unconditionally.

gdb/testsuite/
Implement testsuite workaround for PR breakpoints/13781.
* gdb.cp/mb-templates.exp: New loop with variable $workaround.
(set breakpoint condition-evaluation host): New conditional command.

gdb/ChangeLog
gdb/breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/mb-templates.exp

index 87b7bda453bfd3e035d22f2782cbe0b9c2d64c34..c74db5b72630d660423a1d393dab0956c0532608 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * breakpoint.c (set_condition_evaluation_mode): Set
+       CONDITION_EVALUATION_MODE unconditionally.
+
 2012-03-03  Yao Qi  <yao@codesourcery.com>
 
        * common/agent.c (agent_look_up_symbols): Add one parameter 'arg'.
index 3decd9205279128a03995f41c50bd500f531a101..5388a4e2b54a4c8df1ce51f015d4083f140085b8 100644 (file)
@@ -761,6 +761,10 @@ set_condition_evaluation_mode (char *args, int from_tty,
   new_mode = translate_condition_evaluation_mode (condition_evaluation_mode_1);
   old_mode = translate_condition_evaluation_mode (condition_evaluation_mode);
 
+  /* Flip the switch.  Flip it even if OLD_MODE == NEW_MODE as one of the
+     settings was "auto".  */
+  condition_evaluation_mode = condition_evaluation_mode_1;
+
   /* Only update the mode if the user picked a different one.  */
   if (new_mode != old_mode)
     {
@@ -772,9 +776,6 @@ set_condition_evaluation_mode (char *args, int from_tty,
         "target" -> "host": Remove all the conditions from the target.
       */
 
-      /* Flip the switch.  */
-      condition_evaluation_mode = condition_evaluation_mode_1;
-
       if (new_mode == condition_evaluation_target)
        {
          /* Mark everything modified and synch conditions with the
index cc39a9a88bf6f75b4bd5d51e40fad1624e0f70ed..9df06dd5baf5047da3f1dd5724273930acceb52b 100644 (file)
@@ -1,3 +1,9 @@
+2012-03-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Implement testsuite workaround for PR breakpoints/13781.
+       * gdb.cp/mb-templates.exp: New loop with variable $workaround.
+       (set breakpoint condition-evaluation host): New conditional command.
+
 2012-03-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Code cleanup.
index d386c0290986602bb25f899674d3a2a4df9557ed..e909543d363b6b468f21a091be56a96beb9ed4b7 100644 (file)
@@ -38,24 +38,35 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
      return -1
 }
 
-clean_restart ${executable}
+# If GDB crashes try it again workarounding PR breakpoints/13781.
 
-set bp_location [gdb_get_line_number "set breakpoint here"]
+foreach workaround [list "" " (workaround)"] {
+    clean_restart ${executable}
 
-# Set a breakpoint with multiple locations
-# and a condition.
+    if {${workaround} != ""} {
+       gdb_test_no_output "set breakpoint condition-evaluation host"
+    }
 
-gdb_test "break $srcfile:$bp_location if i==1" \
-    "Breakpoint.*at.*: $srcfile:$bp_location. \\(2 locations\\).*" \
-    "initial condition: set breakpoint"
+    set bp_location [gdb_get_line_number "set breakpoint here"]
 
-gdb_run_cmd
+    # Set a breakpoint with multiple locations
+    # and a condition.
 
-set test "initial condition: run to breakpoint"
-gdb_test_multiple "" $test {
-    -re "Breakpoint \[0-9\]+,.*foo<int> \\(i=1\\).*$gdb_prompt $" {
-       pass $test
-       break
+    gdb_test "break $srcfile:$bp_location if i==1" \
+       "Breakpoint.*at.*: $srcfile:$bp_location. \\(2 locations\\).*" \
+       "initial condition: set breakpoint$workaround"
+
+    gdb_run_cmd
+
+    if {${workaround} == "" && [is_remote target]} {
+       setup_kfail breakpoints/13781 "*-*-*"
+    }
+    set test "initial condition: run to breakpoint$workaround"
+    gdb_test_multiple "" $test {
+       -re "Breakpoint \[0-9\]+,.*foo<int> \\(i=1\\).*$gdb_prompt $" {
+           pass $test
+           break
+       }
     }
 }
 
This page took 0.049391 seconds and 4 git commands to generate.