From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26148 invoked by alias); 4 Jun 2005 03:19:46 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26140 invoked by uid 22791); 4 Jun 2005 03:19:41 -0000 Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 04 Jun 2005 03:19:41 +0000 Received: from farnswood.snap.net.nz (p17-tnt1.snap.net.nz [202.124.110.17]) by viper.snap.net.nz (Postfix) with ESMTP id 2C9D8539412; Sat, 4 Jun 2005 15:19:37 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 1722762A99; Sat, 4 Jun 2005 04:19:02 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17057.7583.990091.951816@farnswood.snap.net.nz> Date: Sat, 04 Jun 2005 03:19:00 -0000 To: Daniel Jacobowitz Cc: Bob Rossi , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Hooks still needed for annotations In-Reply-To: <20050603235923.GA9992@nevyn.them.org> References: <17053.24737.153388.915345@farnswood.snap.net.nz> <20050601113004.GC15414@white> <17054.10607.109160.333076@farnswood.snap.net.nz> <20050603190856.GB32722@nevyn.them.org> <17056.56022.36723.292491@farnswood.snap.net.nz> <20050603235923.GA9992@nevyn.them.org> X-SW-Source: 2005-06/txt/msg00042.txt.bz2 > The way to prevent them from being removed again is to add test cases. OK, I've done this. Running the tests revealed a small bug with "set annotate" -- it didn't call _initialize_annotate to set the hooks. This must be why the tests didn't fail when the hooks were removed in the first place. I've only tested for breakpoints-invalid annotations when breakpoints have been deleted as I could simply adapt existing tests. They should also be present when breakpoints are enabled/disabled. However, this test should be sufficient to prevent the inadvertant removal of the hooks. Nick 2005-06-04 Nick Roberts * event-top.c (change_annotation_level): Call _initialize_annotate. * interps.c (clear_interpreter_hooks): Re-instate deprecated_delete_breakpoint_hook and deprecated_modify_breakpoint_hook for annotations. 2005-06-04 Nick Roberts * gdb.base/annota1.exp, gdb.base/annota3.exp, gdb.cp/annota3.exp: Test for breakpoints-invalid when deleting breakpoints. *** /home/nick/src/gdb/event-top.c.~1.40.~ 2005-03-17 12:23:51.000000000 +1300 --- /home/nick/src/gdb/event-top.c 2005-06-04 14:36:37.000000000 +1200 *************** *** 43,48 **** --- 43,50 ---- /* readline defines this. */ #undef savestring + extern void _initialize_annotate (void); + static void rl_callback_read_char_wrapper (gdb_client_data client_data); static void command_line_handler (char *rl); static void command_line_handler_continuation (struct continuation_arg *arg); *************** *** 359,364 **** --- 361,367 ---- pop_prompt (); } } + _initialize_annotate (); } /* Pushes a new prompt on the prompt stack. Each prompt has three *** /home/nick/src/gdb/event-top.c.~1.40.~ 2005-03-17 12:23:51.000000000 +1300 --- /home/nick/src/gdb/event-top.c 2005-06-04 14:36:37.000000000 +1200 *************** *** 43,48 **** --- 43,50 ---- /* readline defines this. */ #undef savestring + extern void _initialize_annotate (void); + static void rl_callback_read_char_wrapper (gdb_client_data client_data); static void command_line_handler (char *rl); static void command_line_handler_continuation (struct continuation_arg *arg); *************** *** 359,364 **** --- 361,367 ---- pop_prompt (); } } + _initialize_annotate (); } /* Pushes a new prompt on the prompt stack. Each prompt has three *** /home/nick/src/gdb/interps.c.~1.15.~ 2005-04-26 21:44:15.000000000 +1200 --- /home/nick/src/gdb/interps.c 2005-06-04 15:12:16.000000000 +1200 *************** *** 326,333 **** deprecated_query_hook = 0; deprecated_warning_hook = 0; deprecated_create_breakpoint_hook = 0; - deprecated_delete_breakpoint_hook = 0; - deprecated_modify_breakpoint_hook = 0; deprecated_interactive_hook = 0; deprecated_registers_changed_hook = 0; deprecated_readline_begin_hook = 0; --- 326,331 ---- *** /home/nick/src/gdb/testsuite/gdb.base/annota1.exp.~1.17.~ 2005-04-28 17:17:24.000000000 +1200 --- /home/nick/src/gdb/testsuite/gdb.base/annota1.exp 2005-06-04 14:50:08.000000000 +1200 *************** *** 315,321 **** # send_gdb "delete 1\n" gdb_expect { ! -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \ { pass "delete bp 1" } -re ".*$gdb_prompt$" { fail "delete bp 1" } timeout { fail "delete bp 1 (timeout)" } --- 315,321 ---- # send_gdb "delete 1\n" gdb_expect { ! -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\n$gdb_prompt$" \ { pass "delete bp 1" } -re ".*$gdb_prompt$" { fail "delete bp 1" } timeout { fail "delete bp 1 (timeout)" } *************** *** 323,329 **** send_gdb "delete 2\n" gdb_expect { ! -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \ { pass "delete bp 2" } -re ".*$gdb_prompt$" { fail "delete bp 2 " } timeout { fail "delete bp 2 (timeout)" } --- 323,329 ---- send_gdb "delete 2\n" gdb_expect { ! -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\n$gdb_prompt$" \ { pass "delete bp 2" } -re ".*$gdb_prompt$" { fail "delete bp 2 " } timeout { fail "delete bp 2 (timeout)" } *************** *** 331,337 **** send_gdb "delete 3\n" gdb_expect { ! -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \ { pass "delete bp 3" } -re ".*$gdb_prompt$" { fail "delete bp 3" } timeout { fail "delete bp 3 (timeout)" } --- 331,337 ---- send_gdb "delete 3\n" gdb_expect { ! -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\n$gdb_prompt$" \ { pass "delete bp 3" } -re ".*$gdb_prompt$" { fail "delete bp 3" } timeout { fail "delete bp 3 (timeout)" } *** /home/nick/src/gdb/testsuite/gdb.base/annota3.exp.~1.5.~ 2004-07-26 03:41:51.000000000 +1200 --- /home/nick/src/gdb/testsuite/gdb.base/annota3.exp 2005-06-04 14:45:03.000000000 +1200 *************** *** 258,273 **** --- 258,276 ---- send_gdb "delete 1\n" gdb_expect_list "delete bp 1" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" + "\r\n\032\032breakpoints-invalid\r\n" } send_gdb "delete 2\n" gdb_expect_list "delete bp 2" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" + "\r\n\032\032breakpoints-invalid\r\n" } send_gdb "delete 3\n" gdb_expect_list "delete bp 3" "$gdb_prompt$" { "\r\n\032\032post-prompt\r\n" + "\r\n\032\032breakpoints-invalid\r\n" } # *** /home/nick/src/gdb/testsuite/gdb.cp/annota3.exp.~1.3.~ 2004-02-28 09:23:12.000000000 +1300 --- /home/nick/src/gdb/testsuite/gdb.cp/annota3.exp 2005-06-04 14:56:46.000000000 +1200 *************** *** 140,146 **** -re ".*Delete all breakpoints. \\(y or n\\) \r\n\032\032query.*$" { send_gdb "y\n" gdb_expect { ! -re "\r\n\032\032post-query\r\n$gdb_prompt$" { pass "delete bps" } -re ".*$gdb_prompt$" { fail "delete bps" } timeout { fail "delete bps (timeout)" } } --- 140,146 ---- -re ".*Delete all breakpoints. \\(y or n\\) \r\n\032\032query.*$" { send_gdb "y\n" gdb_expect { ! -re "\r\n\032\032post-query\r\n\r\n\032\032breakpoints-invalid\r\n$gdb_prompt$" { pass "delete bps" } -re ".*$gdb_prompt$" { fail "delete bps" } timeout { fail "delete bps (timeout)" } }