]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* breakpoint.c (break_command_really): New parameter
authorVladimir Prus <vladimir@codesourcery.com>
Tue, 22 Jan 2008 19:43:10 +0000 (19:43 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Tue, 22 Jan 2008 19:43:10 +0000 (19:43 +0000)
ignore_count.
(break_command_1): Pass 0 as
ignore_count to break_command_really.
(gdb_breakpoint): Pass ignore_count to
break_command_really.

gdb/ChangeLog
gdb/breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.mi/basics.c
gdb/testsuite/gdb.mi/mi-break.exp
gdb/testsuite/gdb.mi/mi-cli.exp
gdb/testsuite/gdb.mi/mi2-cli.exp

index 00767e509d765c298d6e3b7414ab0a59e28a49e4..3f783a2cfe860a5b05cfb7cd9f4f60f2f4db86c0 100644 (file)
@@ -1,3 +1,12 @@
+2008-01-22  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * breakpoint.c (break_command_really): New parameter
+       ignore_count.
+       (break_command_1): Pass 0 as
+       ignore_count to break_command_really.
+       (gdb_breakpoint): Pass ignore_count to
+       break_command_really.
+
 2008-01-21  Kevin Buettner  <kevinb@redhat.com>
 
        * mn10300-linux-tdep.c (am33_linux_sigframe_cache_init): Find
index 60fbbe57d7cecbaed3092e85bd29ea89a01ad926..9551bd542a5a77b9fd4c46f207dadd8734399114 100644 (file)
@@ -5237,10 +5237,11 @@ find_condition_and_thread (char *tok, CORE_ADDR pc,
 
 static int
 break_command_really (char *arg, char *cond_string, int thread,
-                      int parse_condition_and_thread,
-                      int tempflag, int hardwareflag, 
-                      enum auto_boolean pending_break_support,
-                      int from_tty)
+                     int parse_condition_and_thread,
+                     int tempflag, int hardwareflag, 
+                     int ignore_count,
+                     enum auto_boolean pending_break_support,
+                     int from_tty)
 {
   struct gdb_exception e;
   struct symtabs_and_lines sals;
@@ -5254,7 +5255,6 @@ break_command_really (char *arg, char *cond_string, int thread,
   struct captured_parse_breakpoint_args parse_args;
   int i;
   int pending = 0;
-  int ignore_count = 0;
   int not_found = 0;
 
   sals.sals = NULL;
@@ -5427,6 +5427,7 @@ break_command_1 (char *arg, int flag, int from_tty)
   return break_command_really (arg, 
                               NULL, 0, 1 /* parse arg */,
                               tempflag, hardwareflag,
+                              0 /* Ignore count */,
                               pending_break_support, from_tty);
 }
 
@@ -5441,6 +5442,7 @@ gdb_breakpoint (char *address, char *condition,
   return break_command_really (address, condition, thread,
                               0 /* condition and thread are valid.  */,
                               tempflag, hardwareflag,
+                              ignore_count,
                               pending 
                               ? AUTO_BOOLEAN_TRUE : AUTO_BOOLEAN_FALSE,
                               0);
index 74099f60124edda9c6bd3ead2e6f20e87ba87747..18f387c896fc90a201dd7981019350aef1d28e09 100644 (file)
@@ -1,3 +1,11 @@
+2008-01-22  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * gdb.mi/basics.c: Setup for testing breakpoints
+        ignore count.
+        * gdb.mi/mi-break.exp: Test for breakpoint ignore count.
+        * gdb.mi/mi-cli.exp: Adjust.
+        * gdb.mi/mi2-cli.exp: Adjust.
+
 2008-01-17  Pedro Alves  <pedro@codesourcery.com>
 
        * gdb.mi/mi-var-child.c (do_children_tests): Add 'dummy' integer
index d56bf9dd7149ff161ad2d4f96ce13e598afa3d13..5b52112909214e515fdd70b3765a3a36353e0de1 100644 (file)
@@ -46,6 +46,11 @@ callee1 (int intarg, char *strarg, double fltarg)
   callee2 (intarg, strarg);
 }
 
+void callme (int i)
+{
+  printf ("callme\n");
+}
+
 main ()
 {
   callee1 (2, "A string argument.", 3.5);
@@ -53,6 +58,9 @@ main ()
 
   printf ("Hello, World!");
 
+  callme (1);
+  callme (2);
+
   return 0;
 }
 
index b51fd18ada599ff66babe3d1c0ee61856e47e4e3..af438b9c5d61294f72fc541ac090311b333eb480 100644 (file)
@@ -153,8 +153,32 @@ proc test_rbreak_creation_and_listing {} {
            "delete temp breakpoints"
 }
 
+proc test_ignore_count {} {
+    global mi_gdb_prompt
+
+    mi_gdb_test "-break-insert -i 1 callme" \
+        "\\^done.*ignore=\"1\".*" \
+        "insert breakpoint with ignore count at callme"
+
+    mi_run_cmd
+
+    gdb_expect {
+        -re ".*func=\"callme\".*args=\\\[\{name=\"i\",value=\"2\"\}\\\].*\r\n$mi_gdb_prompt$" {
+            pass "run to breakpoint with ignore count"
+        }
+        -re ".*$mi_gdb_prompt$" {
+            fail "run to breakpoint with ignore count"
+        }
+        timeout {
+            fail "run to breakpoint with ignore count (timeout)"
+        }
+    }  
+}
+
 test_tbreak_creation_and_listing
 test_rbreak_creation_and_listing
 
+test_ignore_count
+
 mi_gdb_exit
 return 0
index 64789b5471834545941062171717b9a17bff2cf6..ef674b039fa5b2bd7c935ec8c3f83fe8eb3561a6 100644 (file)
@@ -186,7 +186,7 @@ gdb_expect {
 }
 
 mi_gdb_test "-interpreter-exec console \"list\"" \
-  "\~\"$line_main_return\[\\\\t ]*return 0;\\\\n\".*\\^done" \
+  "\~\"$line_main_return\[\\\\t ]*callme \\(1\\);\\\\n\".*\\^done" \
   "-interpreter-exec console \"list\" at basics.c:\$line_main_return"
 
 mi_gdb_test "-interpreter-exec console \"help set args\"" \
index ee8d47dda85a62a70c2fe45caeacf1d68a8fe8dc..7879bd7ccf1ffa31bee7c287b6b1270dc02f2eaa 100644 (file)
@@ -186,7 +186,7 @@ gdb_expect {
 }
 
 mi_gdb_test "-interpreter-exec console \"list\"" \
-  "\~\"$line_main_return\[\\\\t ]*return 0;\\\\n\".*\\^done" \
+  "\~\"$line_main_return\[\\\\t ]*callme \\(1\\);\\\\n\".*\\^done" \
   "-interpreter-exec console \"list\" at basics.c:\$line_main_return"
 
 mi_gdb_test "-interpreter-exec console \"help set args\"" \