From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27675 invoked by alias); 26 Feb 2010 12:53:11 -0000 Received: (qmail 27655 invoked by uid 22791); 26 Feb 2010 12:53:10 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Feb 2010 12:53:05 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1QCr4uo031666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 26 Feb 2010 07:53:04 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1QCr2YY026945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 26 Feb 2010 07:53:03 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id o1QCr1pF007319; Fri, 26 Feb 2010 13:53:01 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id o1QCr1F8007318; Fri, 26 Feb 2010 13:53:01 +0100 Date: Fri, 26 Feb 2010 12:53:00 -0000 From: Jan Kratochvil To: Hui Zhu Cc: gdb-patches ml Subject: Re: [RFA] patch for [Bug gdb/11253] Message-ID: <20100226125301.GB6773@host0.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2010-02/txt/msg00651.txt.bz2 On Fri, 26 Feb 2010 04:25:58 +0100, Hui Zhu wrote: > This patch is for bug 11253 http://sourceware.org/bugzilla/show_bug.cgi?id=11253 [..] > --- a/target.c > +++ b/target.c > @@ -2836,6 +2836,7 @@ init_dummy_target (void) > dummy_target.to_has_stack = (int (*) (struct target_ops *)) return_zero; > dummy_target.to_has_registers = (int (*) (struct target_ops *)) return_zero; > dummy_target.to_has_execution = (int (*) (struct target_ops *)) return_zero; > + dummy_target.to_stopped_by_watchpoint = return_zero; > dummy_target.to_magic = OPS_MAGIC; > } while there is already: update_current_target (void) ... INHERIT (to_stopped_by_watchpoint, t); + de_fault (to_stopped_by_watchpoint, (int (*) (void)) return_zero); and I wanted to propose the attached patch I expect it is because INHERITs are deprecated now and current_target.beneath traversal is preferred nowadays. Just posted when I wrote it, IMo the patch of Hui's is the right one instead. No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu. Thanks, Jan 2010-02-26 Jan Kratochvil * record.c (record_open): Initialize tmp_to_insert_breakpoint, tmp_to_remove_breakpoint, tmp_to_stopped_by_watchpoint and tmp_to_stopped_data_address directly from current_target. Remove their initialization during current_target.beneath chain traversal. --- a/gdb/record.c +++ b/gdb/record.c @@ -895,8 +895,10 @@ record_open (char *name, int from_tty) tmp_to_store_registers = NULL; tmp_to_xfer_partial_ops = NULL; tmp_to_xfer_partial = NULL; - tmp_to_insert_breakpoint = NULL; - tmp_to_remove_breakpoint = NULL; + tmp_to_insert_breakpoint = current_target.to_insert_breakpoint; + tmp_to_remove_breakpoint = current_target.to_remove_breakpoint; + tmp_to_stopped_by_watchpoint = current_target.to_stopped_by_watchpoint; + tmp_to_stopped_data_address = current_target.to_stopped_data_address; /* Set the beneath function pointers. */ for (t = current_target.beneath; t != NULL; t = t->beneath) @@ -921,14 +923,6 @@ record_open (char *name, int from_tty) tmp_to_xfer_partial = t->to_xfer_partial; tmp_to_xfer_partial_ops = t; } - if (!tmp_to_insert_breakpoint) - tmp_to_insert_breakpoint = t->to_insert_breakpoint; - if (!tmp_to_remove_breakpoint) - tmp_to_remove_breakpoint = t->to_remove_breakpoint; - if (!tmp_to_stopped_by_watchpoint) - tmp_to_stopped_by_watchpoint = t->to_stopped_by_watchpoint; - if (!tmp_to_stopped_data_address) - tmp_to_stopped_data_address = t->to_stopped_data_address; } if (!tmp_to_xfer_partial) error (_("Could not find 'to_xfer_partial' method on the target stack."));