From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5365 invoked by alias); 25 Mar 2003 16:05:19 -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 5358 invoked from network); 25 Mar 2003 16:05:18 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 25 Mar 2003 16:05:18 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id C23CC2B11; Tue, 25 Mar 2003 11:05:11 -0500 (EST) Message-ID: <3E807E37.8010409@redhat.com> Date: Tue, 25 Mar 2003 16:05:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [rfc breakpoint] Catch exceptions References: <20030325030107.GA3889@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-03/txt/msg00491.txt.bz2 > I'm just looking for feedback on this patch. It's mostly complete except > for some mass re-indenting that some of the changes would require; I'm not > entirely happy with the design yet though, so I'm looking for comments. If you're not happy with a design, the best thing to do is toss it on a branch where it can incubate a little. > The basic idea is that these "catchpoints" are just normal breakpoints and > should be handled as such. But we'd like to print them a little > differently, for clarity. > Here's the interesting bit, from struct breakpoint: This is the more interesting bit: + enum {ep_normal, ep_gnuv2, ep_gnuv3} ep_type; You're expecting multiple implementations ... > + enum print_stop_action (*print) (struct breakpoint *); > + > + void (*print_one) (struct breakpoint *, CORE_ADDR *); > + > + void (*print_mention) (struct breakpoint *); Per frame-unwind, instead put these virutal methods in their own struct and then point the breakpoint at it. Separate v2 and v3 catchpoints (in separate files?) will then be possible (and make the enum unnecessary). Long term, the `breakpoint' code should do everything via these virtual methods. If a breakpoint is hit, the corresponding handler should be called. Those methods should rely on zero globals - pass everything in. Some nits: Just write this: + (*b->print_mention) (b); like: b->print_mention (b) While I know some kernel groups like to use that style, GDB doesn't appear to. This, and related, should be submitted separatly: +extern struct symtab_and_line find_msymbol_start_sal (struct minimal_symbol *, + int); Any chance of a comment? Andrew