This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

2nd try: (patch) hpjyg01: GDB breakpoint ignore count annotation


Resubmission incorporating Michael Snyder's comment, use
annotate_ignore_count_changed instead.

- Jimmy Guo

Index: gdb/ChangeLog
/opt/gnu/bin/diff -r -c -N -L gdb/ChangeLog gdb/ChangeLog@@/GDB_1999_10_25 gdb/ChangeLog
*** gdb/ChangeLog
--- gdb/ChangeLog	Thu Oct 28 17:28:04 1999
***************
*** 1,3 ****
--- 1,13 ----
+ 1999-10-28	Jimmy Guo	<guo@cup.hp.com>
+ 
+ 	* annotate.c (breakpoints_changed,annotate_ignore_count_change,
+ 	annotate_stopped): Provide annotation for breakpoint
+ 	ignore_count changes but only provide once at annotate_stopped
+ 	time for sucessive ignore_count triggered breakpoint changes, to
+ 	make the GUI happy yet lazy.
+ 	* breakpoint.c (bpstat_stop_status): call
+ 	annotate_ignore_count_change when ignore_count changes.
+ 
  Mon Oct 25 18:22:06 1999  Andrew Cagney  <cagney@b1.cygnus.com>
  
  	* remote.c: Document future of compare_sections_command.
Index: gdb/annotate.c
/opt/gnu/bin/diff -r -c -N -L gdb/annotate.c gdb/annotate.c@@/GDB_1999_10_25 gdb/annotate.c
*** gdb/annotate.c
--- gdb/annotate.c	Thu Oct 28 17:26:57 1999
***************
*** 40,45 ****
--- 40,47 ----
  void (*annotate_signal_hook) PARAMS ((void));
  void (*annotate_exited_hook) PARAMS ((void));
  
+ static int ignore_count_changed = 0;
+ 
  static void
  print_value_flags (t)
       struct type *t;
***************
*** 57,65 ****
--- 59,81 ----
      {
        target_terminal_ours ();
        printf_unfiltered ("\n\032\032breakpoints-invalid\n");
+       if (ignore_count_changed)
+ 	ignore_count_changed = 0;	/* Avoid multiple break annotations. */
      }
  }
  
+ /* The GUI needs to be informed of ignore_count changes, but we don't
+    want to provide successive multiple breakpoints-invalid messages
+    that are all caused by the fact that the ignore count is changing
+    (which could keep the GUI very busy).  One is enough, after the target
+    actually "stops". */
+ void
+ annotate_ignore_count_change ()
+ {
+   if (annotation_level > 1)
+     ignore_count_changed = 1;
+ }
+ 
  void
  annotate_breakpoint (num)
       int num;
***************
*** 108,113 ****
--- 124,134 ----
      {
        if (annotation_level > 1)
  	printf_filtered ("\n\032\032stopped\n");
+     }
+   if (annotation_level > 1 && ignore_count_changed)
+     {
+       ignore_count_changed = 0;
+       breakpoints_changed ();
      }
  }
  
Index: gdb/breakpoint.c
/opt/gnu/bin/diff -r -c -N -L gdb/breakpoint.c gdb/breakpoint.c@@/GDB_1999_10_25 gdb/breakpoint.c
*** gdb/breakpoint.c
--- gdb/breakpoint.c	Thu Oct 28 17:27:10 1999
***************
*** 2420,2425 ****
--- 2420,2426 ----
  	else if (b->ignore_count > 0)
  	  {
  	    b->ignore_count--;
+ 	    annotate_ignore_count_change ();
  	    bs->stop = 0;
  	  }
  	else
Index: gdb/testsuite/ChangeLog
/opt/gnu/bin/diff -r -c -N -L gdb/testsuite/ChangeLog gdb/testsuite/ChangeLog@@/GDB_1999_10_25 gdb/testsuite/ChangeLog
*** gdb/testsuite/ChangeLog
--- gdb/testsuite/ChangeLog	Thu Oct 28 16:57:38 1999
***************
*** 1,3 ****
--- 1,9 ----
+ 1999-10-28	Jimmy Guo	<guo@cup.hp.com>
+ 
+ 	* gdb.base/annota1.c, gdb.base/annota1.exp: add test to check
+ 	that breakpoint ignore count changes are annotated but only once
+ 	for successive ignore count changes.
+ 
  1999-10-18  Jim Blandy  <jimb@zwingli.cygnus.com>
  
  	* gdb.threads/linux-dp.c, gdb.threads/linux-dp.exp: New test suite
Index: gdb/testsuite/gdb.base/annota1.c
/opt/gnu/bin/diff -r -c -N -L gdb/testsuite/gdb.base/annota1.c gdb/testsuite/gdb.base/annota1.c@@/GDB_1999_10_25 gdb/testsuite/gdb.base/annota1.c
*** gdb/testsuite/gdb.base/annota1.c
--- gdb/testsuite/gdb.base/annota1.c	Thu Oct 28 16:01:53 1999
***************
*** 39,44 ****
--- 39,50 ----
  
    printf ("value is %d\n", value);
    printf ("my_array[2] is %d\n", my_array[2]);
+   
+   {
+     int i;
+     for (i = 0; i < 5; i++)
+       value++;
+   }
  
    return 0;
  }
Index: gdb/testsuite/gdb.base/annota1.exp
/opt/gnu/bin/diff -r -c -N -L gdb/testsuite/gdb.base/annota1.exp gdb/testsuite/gdb.base/annota1.exp@@/GDB_1999_10_25 gdb/testsuite/gdb.base/annota1.exp
*** gdb/testsuite/gdb.base/annota1.exp
--- gdb/testsuite/gdb.base/annota1.exp	Thu Oct 28 16:42:43 1999
***************
*** 359,364 ****
--- 359,412 ----
    timeout { fail "re-run (timeout)" }
  }
  
+ #
+ # Test that breakpoints-invalid is issued once and only once for
+ # breakpoint ignore count changes, after annotation stopped.
+ #
+ send_gdb "break 46\n"
+ gdb_expect {
+     -re "Breakpoint 5 at $hex: file .*$srcfile, line 46.*$gdb_prompt$" {
+ 	pass "break at 46"
+     }
+     -re ".*$gdb_prompt$" { fail "break at 46" }
+     timeout { fail "break at 46 (timeout)" }
+ }
+ 
+ send_gdb "ignore 5 4\n"
+ gdb_expect {
+     -re "Will ignore next 4 crossings of breakpoint 5.*$gdb_prompt$" {
+ 	pass "ignore 5 4"
+     }
+     -re ".*$gdb_prompt$" { fail "ignore 5 4" }
+     timeout { fail "ignore 5 4 (timeout)" }
+ }
+ 
+ send_gdb "continue\n"
+ gdb_expect {
+     -re ".*$srcfile:46:.*\032\032stopped\r\n\r\n\032\032breakpoints-invalid\r\n$gdb_prompt$" {
+ 	pass "annotate ignore count change"
+     }
+     -re ".*$gdb_prompt$" { fail "annotate ignore count change" }
+     timeout { fail "annotate ignore count change (timeout)" }
+ }
+ 
+ # check that ignore command is working, or the above can provide
+ # misleading assurance ...
+ 
+ send_gdb "next\n"
+ gdb_expect {
+     -re "$gdb_prompt$" {}
+     timeout { fail "next to exit loop" }
+ }
+ 
+ send_gdb "next\n"
+ gdb_expect {
+     -re ".*$srcfile:49:.*$gdb_prompt$" {
+ 	pass "breakpoint ignore count"
+     }
+     -re ".*$gdb_prompt$" { fail "breakpoint ignore count" }
+     timeout { fail "breakpoint ignore count (timeout)" }
+ }
  
  #
  # Send a signal that is not handled; test:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]