From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14565 invoked by alias); 25 Apr 2006 10:16:59 -0000 Received: (qmail 14556 invoked by uid 22791); 25 Apr 2006 10:16:58 -0000 X-Spam-Check-By: sourceware.org Received: from ausmtp04.au.ibm.com (HELO ausmtp04.au.ibm.com) (202.81.18.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Apr 2006 10:16:55 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp04.au.ibm.com (8.13.6/8.13.5) with ESMTP id k3PAQqjD286674 for ; Tue, 25 Apr 2006 20:26:52 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k3PAKAS6229106 for ; Tue, 25 Apr 2006 20:20:10 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11/8.13.3) with ESMTP id k3PAGo48029734 for ; Tue, 25 Apr 2006 20:16:50 +1000 Received: from [9.181.142.249] ([9.181.142.249]) by d23av03.au.ibm.com (8.12.11/8.12.11) with ESMTP id k3PAGmTS029647 for ; Tue, 25 Apr 2006 20:16:49 +1000 Date: Tue, 25 Apr 2006 12:54:00 -0000 From: Wu Zhou To: gdb@sources.redhat.com Subject: Some questions w.r.t remote watchpoint support in i386 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/msg00305.txt.bz2 Hello all, 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. Then I start gdbserver and gdb on the same machine. There is no such error any more. And it seems that most gdb commands work ok. But I encounter some problems with h/w watchpoint operations. I did some search, and don't find much information about my problems. So I choose to ask here: 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? Any comments on this thought? Thanks. 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? As far as I understand, now that the underlying target support hardware watchpoint, there is not any practical obstacle for gdbserver on i386 to support this kind of packets. If I am wrong, please forgive me and correct me. (I am no expert in this field anyway. :-) 3. I also have a question about the overall status of gdb's support for remote debugging on different platforms. The available documents (gdb manual, gdb internal) don't mention much information about this. I had thought that all commands avaialbe in local gdb will also work in remote mode. But the practice prove that I am wrong. Playing with remote debugging always make me feel a little frustrated. (I am not very sure what other feels. I guess embedded people will feel more comfortable. :-) Regards - Wu Zhou