From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109702 invoked by alias); 19 Dec 2016 19:08:10 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 109673 invoked by uid 89); 19 Dec 2016 19:08:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=issuing, sk:do_map_, gdb.execute, gdbexecute X-HELO: gproxy5-pub.mail.unifiedlayer.com Received: from gproxy5-pub.mail.unifiedlayer.com (HELO gproxy5-pub.mail.unifiedlayer.com) (67.222.38.55) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Mon, 19 Dec 2016 19:08:00 +0000 Received: (qmail 28707 invoked by uid 0); 19 Dec 2016 19:07:58 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy5.mail.unifiedlayer.com with SMTP; 19 Dec 2016 19:07:58 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id Mv7v1u00J2f2jeq01v7ybE; Mon, 19 Dec 2016 12:07:58 -0700 X-Authority-Analysis: v=2.1 cv=G8WPTbU5 c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=n5n_aSjo0skA:10 a=pGLkceISAAAA:8 a=hoxHqU16OBAR6Ng2yuIA:9 a=6kGIvZw6iX1k4Y-7sg4_:22 Received: from 75-171-175-27.hlrn.qwest.net ([75.171.175.27]:43836 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1cJ3Hu-0008M1-Tj; Mon, 19 Dec 2016 12:07:55 -0700 From: Tom Tromey To: Martin Galvan Cc: gdb@sourceware.org, tom@tromey.com, Pedro Alves , "dgutson ." Subject: Re: [RFC] Setting breakpoint commands from the Python API References: Date: Mon, 19 Dec 2016 19:08:00 -0000 In-Reply-To: (Martin Galvan's message of "Mon, 19 Dec 2016 15:51:05 -0300") Message-ID: <8737hjyby0.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1cJ3Hu-0008M1-Tj X-Source-Sender: 75-171-175-27.hlrn.qwest.net (pokyo) [75.171.175.27]:43836 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-12/txt/msg00029.txt.bz2 >>>>> "Martin" == Martin Galvan writes: Martin> Doing gdb.execute('commands 2 3 4\necho "Hello World"\nend') Martin> doesn't work either. Yes, IIRC multi-line commands can't be evaluated with gdb.execute. It would be nice to lift this restriction. Martin> In view of this I'm thinking of adding a new 'set_commands' method to Martin> gdb.Breakpoint. For the implementation I was looking at Martin> do_map_commands_command, which is called when issuing 'commands' from Martin> the gdb CLI, but can also take an already parsed command (when info-> control != NULL). However, before I went any further I wanted to Martin> ask you guys if there's another way to do this that I'm missing, or if Martin> there are any suggestions. How about just allowing assignment of the .commands attribute? I think that would be more in keeping with the other attributes of gdb.Breakpoint. thanks, Tom