From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2826 invoked by alias); 25 Apr 2006 12:54:27 -0000 Received: (qmail 2785 invoked by uid 22791); 25 Apr 2006 12:54:26 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 25 Apr 2006 12:54:25 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FYN3e-0005YU-Hp; Tue, 25 Apr 2006 08:54:22 -0400 Date: Tue, 25 Apr 2006 19:34:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: gdb@sources.redhat.com Subject: Re: Some questions w.r.t remote watchpoint support in i386 Message-ID: <20060425125422.GB21293@nevyn.them.org> Mail-Followup-To: Wu Zhou , gdb@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00307.txt.bz2 On Tue, Apr 25, 2006 at 06:19:53PM +0800, Wu Zhou wrote: > I am playing with remote debugging on i386 platform. At the very first, I > start gdbserver and gdb on two different i386 machines. In this configuration, > local gdb client can connect to remote gdb server. But after I set a > breakpoint and issue "cont" command, remote debuggee get a SIGV error. Mismatched libraries between the two is the likely cause. You can copy the target libraries to the host and use set solib-absolute-prefix. > 1. The first error I encounter is: "Couldn't write debug register: No such > process". > > After some tracking, I found gdb client is calling target_insert_watchpoint > defined in config/i386/nm-i386.h, instead of the remote_insert_watchpoint > defined in remote.c > > I guess this is a more general problem. Whenever you change target under > i386 platform, you will always get the i386_insert_watchpoint (and other > three target operations) executed. > > Maybe we can put these target operation into the target_ops, instead of > defining them as macro in config/i386/nm-i386.h? Yes, someone needs to fix this. > 2. Following the above thought, I comment out these four macros in > config/i386/nm-i386.h, and add them into i386-linux-nat.c > > This time, local gdb will call remote_insert_watchpoint indeed, but I get > another error: > > Can't clear hardware watchpoints without the 'Z2' (write-watchpoint) packet. > > "set debug remote 1" tell me that Packet Z2 (write-watchpoint) is NOT > supported > > I tried to use "set remote write-watchpoint-packet 1", but it won't work > either: > > Enabled packet Z2 (write-watchpoint) not recognized by stub > > my question here is: > > What is the stub refered to here? Is it the gdbserver? And how can > gdbserver determine which packat he will support, which won't? The stub is gdbserver, yes. It supports what it supports, and does not support what no one has implemented! And no one has implemented i386 watchpoints for gdbserver. > 3. I also have a question about the overall status of gdb's support for > remote debugging on different platforms. Mostly it depends on the stub. -- Daniel Jacobowitz CodeSourcery