From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27348 invoked by alias); 29 Mar 2010 15:12:12 -0000 Received: (qmail 27333 invoked by uid 22791); 29 Mar 2010 15:12:12 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Mar 2010 15:12:07 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2TFC54P021347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Mar 2010 11:12:05 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2TFC2uV029037; Mon, 29 Mar 2010 11:12:03 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o2TFC1xm023459; Mon, 29 Mar 2010 11:12:02 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 872C8378212; Mon, 29 Mar 2010 09:12:01 -0600 (MDT) From: Tom Tromey To: Yogesh Mundada Cc: gdb@sourceware.org Subject: Re: Some help required with gdb-python scripting References: <1957618c1003270459v78686a64wcfe050bd24ff5742@mail.gmail.com> Reply-To: tromey@redhat.com Date: Mon, 29 Mar 2010 15:12:00 -0000 In-Reply-To: <1957618c1003270459v78686a64wcfe050bd24ff5742@mail.gmail.com> (Yogesh Mundada's message of "Sat, 27 Mar 2010 07:59:45 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2010-03/txt/msg00212.txt.bz2 >>>>> "Yogesh" == Yogesh Mundada writes: Yogesh> 1. Is there any way to disable this 'more' type editor feature after Yogesh> every few lines? "set pagination off" Inside gdb you can use the _unfiltered functions to bypass the pagination. These aren't exposed to Python, however. In your particular case, you could avoid the use of `call', and not get things printed out. You could either do this by writing a new command instead of a convenience function, or by simply having your breakpoint commands invoke the Python directly using the 'python' command. Yogesh> 2. How can I examine value of eax register in the function Yogesh> call_profiler()? I tried - fr.read_var('%eax'), Yogesh> fr.read_var('$eax') and fr.read_var('eax') - but all of them Yogesh> give me an error saying that the variable not found. Try gdb.parse_and_eval('$eax') Yogesh> 3. Is there any way to stop execution and give control back to the Yogesh> user if some condition is true? No. I want to say "not yet" but I am not sure about that. Yogesh> 4. Is there any way to make this process completely automated without Yogesh> me ever requiring to set breakpoints or put commands for breakpoints? I am not sure. Maybe you could try gdb.execute with an argument containing newlines. I don't know if that will work or not. If not, then I don't think there is a very good way at present. You can make a temporary file and source it -- yuck. The archer-tromey-python branch has some more direct support for breakpoints. Maybe you can set the commands directly there; I don't remember offhand. Phil is in the process of merging this upstream. Tom