From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18913 invoked by alias); 14 Apr 2002 21:49:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18906 invoked from network); 14 Apr 2002 21:49:19 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 14 Apr 2002 21:49:19 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 70F6B3C3F; Sun, 14 Apr 2002 17:49:24 -0400 (EDT) Message-ID: <3CB9F964.4010409@cygnus.com> Date: Sun, 14 Apr 2002 14:49:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.9) Gecko/20020328 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eli Zaretskii Cc: drow@mvista.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix watchpoints when stepping over a breakpoint References: <20020402184333.A8464@nevyn.them.org> <6480-Fri05Apr2002103430+0300-eliz@is.elta.co.il> <20020405105416.A14105@nevyn.them.org> <9743-Fri05Apr2002194115+0300-eliz@is.elta.co.il> <20020405120851.A17113@nevyn.them.org> <4331-Sat06Apr2002104144+0300-eliz@is.elta.co.il> <20020406103621.A12359@nevyn.them.org> <2950-Sat06Apr2002201725+0300-eliz@is.elta.co.il> <20020406124912.A24394@nevyn.them.org> <3CB070D6.7060902@cygnus.com> <7263-Sun07Apr2002195334+0300-eliz@is.elta.co.il> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg00507.txt.bz2 > Date: Sun, 07 Apr 2002 12:16:22 -0400 >> From: Andrew Cagney >> >> What would it take to replace DECR_PC_AFTER_BREAK with a read_pc() >> function that determines the stop address from the i386 hardware >> registers and other state information? Tried it (yes i386). It is more complicated (suprise) than I thought. As far as I can tell, the i386 backend can't locally differentiate between a single step trap or a breakpoint trap. Instead it needs to refer to GDB's internal state to figure out what it was probably trying to do. > How would that help to solve this specific problem? The original > problem happened on i386 as well, right? So at best, you'd be pushing > the ``rat's nest'' from GDB application level to x86-specific parts of > GDB, where there still will be need to decide what kind of breakpoint > to reports to the application level. > > Or am I missing something? > > In general, it strikes me that breakpoint.c's design goes against what > you propose: it defines an API where GDB queries the target about the > status of all the known break/watchpoints, and then decides what > happened based on what the target reports. You seem to suggest a > different strategy: let the target tell GDB what happened. While > certainly a viable idea, it sounds like a major redesign of a central > GDB facility, no? No that would remain. I'm just looking at the read_pc() / DECR_PC_AFTER_BREAK pair. In bpstat_stop_status(), for instance, there is a call to get_current_frame() that creates a frame with the wrong PC value :-( Andrew