From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14252 invoked by alias); 9 Apr 2010 17:23:41 -0000 Received: (qmail 14236 invoked by uid 22791); 9 Apr 2010 17:23:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Apr 2010 17:23:35 +0000 Received: (qmail 6492 invoked from network); 9 Apr 2010 17:23:33 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Apr 2010 17:23:33 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, tromey@redhat.com Subject: Re: PR8554: New command to save breakpoints to a file Date: Fri, 09 Apr 2010 17:23:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) References: <201004090341.14389.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004091823.31659.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00268.txt.bz2 On Friday 09 April 2010 17:17:31, Tom Tromey wrote: > >>>>> "Pedro" == Pedro Alves writes: > > Pedro> (I finished this instead of dumping it.) > > Thanks. I do like this approach. > > Pedro> Add a new save-breakpoints command to save breakpoint definitions > Pedro> to a file. > > I'd personally prefer "save breakpoints", with a space, and make > save-tracepoints a deprecated alias for "save tracepoints". What do you > (and others) think of this? I tend to like simple commands with spaces, > especially when a subcommand comes along. Fine with me. > Pedro> The new breakpoint_ops->print_recreate method implementation for > Pedro> all catchpoints is always mostly a simplified version of > Pedro> breakpoint_ops->print_mention method. > > Could you enlighten me on a historical (?) point? Why is it that some > kinds of breakpoints have methods like this and some do not? Is this an > incomplete transition, or an intentional design choice? I think the former. breakpoint_ops was added initialy for some catchpoints in 2003. I wasn't around then. > > Pedro> + if (tp->thread != -1) > Pedro> + fprintf_unfiltered (fp, " thread %d", tp->thread); > Pedro> + > Pedro> + if (tp->task != 0) > Pedro> + fprintf_unfiltered (fp, " task %d", tp->task); > Pedro> + > Pedro> if (tp->cond_string) > Pedro> fprintf_unfiltered (fp, " if %s", tp->cond_string); > > I don't think this syntax will work for a conditional catchpoint. > Our Python-based implementation gets this wrong as well. I think you > need a separate "cond" command in the output. You're right. It works for breakpoints, but not for other types: (top-gdb) b main thread 1 if 0 Breakpoint 4 at 0x4572b3: file ../../src/gdb/gdb.c, line 28. (top-gdb) watch main thread 1 if 0 Junk at end of command. The `b *0xaddr thread 1 if 0' syntax may not work for some languages. I'll post an updated patch, once I update it. :-) -- Pedro Alves