From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20460 invoked by alias); 8 Oct 2002 17:30:57 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 20453 invoked from network); 8 Oct 2002 17:30:56 -0000 Received: from unknown (HELO scrabble.freeuk.net) (212.126.144.6) by sources.redhat.com with SMTP; 8 Oct 2002 17:30:56 -0000 Received: from adsl-solo-39-253.claranet.co.uk ([213.253.39.253] helo=picochip.com) by scrabble.freeuk.net with esmtp (Exim 3.36 #2) id 17yyC7-0008YY-00 for gdb@sources.redhat.com; Tue, 08 Oct 2002 18:30:55 +0100 Message-ID: <3DA31691.5090207@picochip.com> Date: Tue, 08 Oct 2002 10:30:00 -0000 From: Dan Towner Organization: picoChip Designs Ltd. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: The value of inferior_ptid for remote debugging targets Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg00071.txt.bz2 Hi all, I am porting gdb so that it can be used to debug remote debugging targets, which are embedded processors. gdb communicates with the remote target using a monitor program, running on the same machine as gdb. Gdb invokes the monitor program using `serial_open', and uses pipes to communicate with it. I am encountering a problem when I try to use watchpoints. Whenever I set a watchpoint, the variable goes out of scope immediately I begin continuing the program being debugged. I have determined that the cause is the following code, which appears in blockframe.c:reinit_frame_cache /* FIXME: The inferior_ptid test is wrong if there is a corefile. */ if (PIDGET (inferior_ptid) != 0) { select_frame (get_current_frame (), 0); } The inferior_ptid is 0 when this is called, hence the current frame is never selected. This in turn means that the current scope cannot be determined, and hence watchpoints don't work. What is the correct value of inferior_ptid for remote targets, and why shouldn't the above code be called when a remote target is active? Should the inferior_ptid be setup so that the above code doesn't fail? any help greatly appreciated... dan. ============================================================================= Daniel Towner picoChip Designs Ltd., Riverside Buildings, 108, Walcot Street, BATH, BA1 5BG dant@picochip.com 07786 702589