From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17621 invoked by alias); 17 Jan 2006 09:35:10 -0000 Received: (qmail 17613 invoked by uid 22791); 17 Jan 2006 09:35:10 -0000 X-Spam-Check-By: sourceware.org Received: from svr68.ehostpros.com (HELO svr68.ehostpros.com) (67.15.48.48) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Jan 2006 09:35:07 +0000 Received: from [59.95.58.2] (helo=titan.linsyssoft.com) by svr68.ehostpros.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52) id 1EynEv-000174-JE for gdb-patches@sources.redhat.com; Tue, 17 Jan 2006 01:34:59 -0800 Received: from chanakya (chanakya [192.168.1.24] (may be forged)) by titan.linsyssoft.com (8.13.1/8.13.1) with ESMTP id k0H9LVhc017996 for ; Tue, 17 Jan 2006 14:51:31 +0530 Subject: h/w watchpoint pointer initialization patch. From: Jitendra Pawar To: gdb-patches@sources.redhat.com Content-Type: multipart/mixed; boundary="=-D11RpCF2ZHkJVbIKh6TN" Date: Tue, 17 Jan 2006 09:35:00 -0000 Message-Id: <1137490473.3508.33.camel@chanakya.linsyssoft.com> Mime-Version: 1.0 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00210.txt.bz2 --=-D11RpCF2ZHkJVbIKh6TN Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 831 Hi All, While debugging cvs gdb, I put a h/w watch point, when this watch point hits gdb calls target_insert_watchpoint macro. This macro defination is present in target.h as bellow: #define target_insert_watchpoint(addr, len, type) \ (*current_target.to_insert_watchpoint) (addr, len, type) In case of remote debugging *current_target.to_insert_watchpoint points to remote_target_insert_watchpoint function, but while native debugging it should points to _insert_watchpoint (e.g. i386_insert_watchpoint) instead it points to return_minus_one function. This patch removes declaration of macros in file gdb/config/i386/nm- i386.h for insertion and removal of h/w watchpoints. Instead it initializes register access methods in gdb/i386-linux-nat.c file. That fixes the above problem. thanks - Jitendra --=-D11RpCF2ZHkJVbIKh6TN Content-Disposition: attachment; filename=hw_watchpt_pointer_initialization.patch Content-Type: text/x-patch; name=hw_watchpt_pointer_initialization.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 1088 --- src.orig/gdb/i386-linux-nat.c 2005-09-10 23:41:02.000000000 +0530 +++ src/gdb/i386-linux-nat.c 2006-01-16 19:31:29.000000000 +0530 @@ -842,6 +842,8 @@ /* Add our register access methods. */ t->to_fetch_registers = i386_linux_fetch_inferior_registers; t->to_store_registers = i386_linux_store_inferior_registers; + t->to_insert_watchpoint = i386_insert_watchpoint; + t->to_remove_watchpoint = i386_remove_watchpoint; /* Register the target. */ add_target (t); --- src.orig/gdb/config/i386/nm-i386.h 2004-10-08 23:00:48.000000000 +0530 +++ src/gdb/config/i386/nm-i386.h 2006-01-17 12:31:37.299432944 +0530 @@ -97,14 +97,6 @@ #define target_stopped_data_address(target, x) i386_stopped_data_address(x) -/* Use these macros for watchpoint insertion/removal. */ - -#define target_insert_watchpoint(addr, len, type) \ - i386_insert_watchpoint (addr, len, type) - -#define target_remove_watchpoint(addr, len, type) \ - i386_remove_watchpoint (addr, len, type) - #define target_insert_hw_breakpoint(addr, shadow) \ i386_insert_hw_breakpoint (addr, shadow) --=-D11RpCF2ZHkJVbIKh6TN--