From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32302 invoked by alias); 26 Dec 2008 07:09:31 -0000 Received: (qmail 32288 invoked by uid 22791); 26 Dec 2008 07:09:29 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,KAM_MX,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from inet-tsb5.toshiba.co.jp (HELO imx2.toshiba.co.jp) (202.33.96.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Dec 2008 07:08:30 +0000 Received: from arc1.toshiba.co.jp ([133.199.194.235]) by imx2.toshiba.co.jp with ESMTP id mBQ78MDP010451; Fri, 26 Dec 2008 16:08:22 +0900 (JST) Received: (from root@localhost) by arc1.toshiba.co.jp id mBQ78M1R017772; Fri, 26 Dec 2008 16:08:22 +0900 (JST) Received: from unknown [133.199.192.144] by arc1.toshiba.co.jp with ESMTP id SAA17771; Fri, 26 Dec 2008 16:08:22 +0900 Received: from mx12.toshiba.co.jp (localhost [127.0.0.1]) by ovp2.toshiba.co.jp with ESMTP id mBQ78LCM025850; Fri, 26 Dec 2008 16:08:22 +0900 (JST) Received: from mx.tjsys.co.jp by toshiba.co.jp id mBQ78LI3002015; Fri, 26 Dec 2008 16:08:21 +0900 (JST) Received: from voltage-out.tjsys.co.jp (voltage-out.tjsys.co.jp [157.79.3.51]) by mx.tjsys.co.jp (8.12.11/8.12.11) with ESMTP id mBQ78KGQ002589; Fri, 26 Dec 2008 16:08:20 +0900 (JST) Received: from is-com10 ([157.79.3.71]) by voltage-out.tjsys.co.jp (8.13.1/8.13.1) with SMTP id mBQ78FmQ022740; Fri, 26 Dec 2008 16:08:15 +0900 Received: from localhost ([157.79.30.228]) by ims.tjsys.co.jp (iPlanet Messaging Server 5.2 HotFix 2.10 (built Dec 26 2005)) with ESMTP id <0KCH00HMS2HN2H@ims.tjsys.co.jp>; Fri, 26 Dec 2008 16:08:11 +0900 (JST) Date: Fri, 26 Dec 2008 07:09:00 -0000 From: Emi SUZUKI Subject: Re: Watchpoint on an unloaded shared library(1) In-reply-to: <20081226061055.GA4216@adacore.com> To: brobecker@adacore.com Cc: gdb-patches@sourceware.org Message-id: <20081226.160820.01367812.emi-suzuki@tjsys.co.jp> MIME-version: 1.0 Content-type: Text/Plain; charset=us-ascii Content-transfer-encoding: 7bit References: <20081222032758.GA2835@adacore.com> <20081225.202730.01371998.emi-suzuki@tjsys.co.jp> <20081226061055.GA4216@adacore.com> X-WAuditID: 0812261608110000025144 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-12/txt/msg00412.txt.bz2 Hello Joel, From: Joel Brobecker Subject: Re: Watchpoint on an unloaded shared library(1) Date: Fri, 26 Dec 2008 10:10:55 +0400 >> This does work for me, except one duplication of the codes (that you >> may have noticed already): >> >> static void >> do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition) >> { >> int target_resources_ok, other_type_used; >> struct value *mark; >> >> if (bpt->type == bp_hardware_breakpoint) > > Not quite: As you can see, this part of the code deals with hardware > *breakpoints*, not watchpoints. Shame on me... I've totally missed that :-( >> I would try to address incapabilities on PPC after those codes are >> committed. Thank you for taking care of it! > > Er, ... Can you send a patch? I was merely suggesting a different > approach that I hoped would work. Certainly; is it like below then? 2008-12-26 Joel Brobecker Emi Suzuki * breakpoint.c (do_enable_breakpoint): Use update_watchpoint for watchpoints. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.367 diff -u -r1.367 breakpoint.c --- breakpoint.c 22 Dec 2008 04:37:37 -0000 1.367 +++ breakpoint.c 26 Dec 2008 06:55:49 -0000 @@ -7765,56 +7765,17 @@ bpt->type == bp_read_watchpoint || bpt->type == bp_access_watchpoint) { - struct frame_id saved_frame_id; - - saved_frame_id = get_frame_id (get_selected_frame (NULL)); - if (bpt->exp_valid_block != NULL) + struct gdb_exception e; + TRY_CATCH (e, RETURN_MASK_ALL) { - struct frame_info *fr = - fr = frame_find_by_id (bpt->watchpoint_frame); - if (fr == NULL) - { - printf_filtered (_("\ -Cannot enable watchpoint %d because the block in which its expression\n\ -is valid is not currently in scope.\n"), bpt->number); - return; - } - select_frame (fr); + update_watchpoint (bpt, 1 /* reparse */); } - - if (bpt->val) - value_free (bpt->val); - mark = value_mark (); - fetch_watchpoint_value (bpt->exp, &bpt->val, NULL, NULL); - if (bpt->val) - release_value (bpt->val); - bpt->val_valid = 1; - - if (bpt->type == bp_hardware_watchpoint || - bpt->type == bp_read_watchpoint || - bpt->type == bp_access_watchpoint) + if (e.reason < 0) { - int i = hw_watchpoint_used_count (bpt->type, &other_type_used); - int mem_cnt = can_use_hardware_watchpoint (bpt->val); - - /* Hack around 'unused var' error for some targets here */ - (void) mem_cnt, (void) i; - target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT ( - bpt->type, i + mem_cnt, other_type_used); - /* we can consider of type is bp_hardware_watchpoint, convert to - bp_watchpoint in the following condition */ - if (target_resources_ok < 0) - { - printf_filtered (_("\ -Cannot enable watchpoint %d because target watch resources\n\ -have been allocated for other watchpoints.\n"), bpt->number); - value_free_to_mark (mark); - return; - } + exception_fprintf (gdb_stderr, e, _("Cannot enable watchpoint %d: "), + bpt->number); + return; } - - select_frame (frame_find_by_id (saved_frame_id)); - value_free_to_mark (mark); } if (bpt->enable_state != bp_permanent) Anyway, thank you for your help! -- Emi SUZUKI / emi-suzuki at tjsys.co.jp