From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8884 invoked by alias); 28 Jun 2010 20:25:55 -0000 Received: (qmail 8854 invoked by uid 22791); 28 Jun 2010 20:25:45 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,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, 28 Jun 2010 20:25:40 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5SKPagC007666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Jun 2010 16:25:36 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5SKPZ22000494; Mon, 28 Jun 2010 16:25:36 -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 o5SKPZEW006920; Mon, 28 Jun 2010 16:25:35 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id D88FF378967; Mon, 28 Jun 2010 14:25:34 -0600 (MDT) From: Tom Tromey To: Steffen Dettmer Cc: gdb@sourceware.org Subject: Re: gdb "automation" question References: Reply-To: tromey@redhat.com Date: Mon, 28 Jun 2010 20:25:00 -0000 In-Reply-To: (Steffen Dettmer's message of "Mon, 28 Jun 2010 17:11:44 +0200") 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-06/txt/msg00139.txt.bz2 >>>>> "Steffen" == Steffen Dettmer writes: Steffen> thanks to Tom and others I made progress to automatically display Steffen> my remote log messages using python-enabled gdb-7.1. Steffen> #1 When several messages were printed, I get Steffen> ---Type to continue, or q to quit--- Steffen> is there a way to avoid it? "set pagination off". If you're referring to script-generated output, I don't think we currently have a way to print unfiltered. Steffen> #2 How do I write show_log in Python? According to the online manual Steffen> `Python representation of symbols' I understood that I have to Steffen> use gdb.lookup_symbol. Is this right? I tried Steffen> gdb.lookup_symbol("logStaticLogBuffer") Steffen> but this only leads to Steffen> AttributeError: 'module' object has no attribute 'lookup_symbol' You need a newer gdb. lookup_symbol was added after 7.1. Steffen> #3 my connect command has to disable breakpoints. Steffen> I cannot re-enable them, because it does not know which Steffen> breakpoints were enabled and which not. I think with a newer gdb you could compute this info from Python. Steffen> #4 How do I source ~/.gdbinit.py if and only if I have a python-enabled Steffen> gdb? Steffen> If not possible: Steffen> Would it be an idea for a future version to add such a feature? I don't think there is a way. It would be reasonable to add something. I think question #5 is implicitly answered by the above... Steffen> #6 BTW, why does `source ~/.gdbinit.py' work? Is the file name Steffen> extension telling that it contains Python syntax? Yes, see "set script-extension". Tom