From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13218 invoked by alias); 31 Mar 2011 20:10:38 -0000 Received: (qmail 13193 invoked by uid 22791); 31 Mar 2011 20:10:34 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from eu1sys200aog110.obsmtp.com (HELO eu1sys200aog110.obsmtp.com) (207.126.144.129) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Mar 2011 20:10:29 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKTZTfsiZ/sI1mOPeTlPneAgV9jlIK+F4T@postini.com; Thu, 31 Mar 2011 20:10:29 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 14238B6; Thu, 31 Mar 2011 20:10:25 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas1.st.com [10.75.90.14]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B0C8947B4; Thu, 31 Mar 2011 20:10:25 +0000 (GMT) Received: from SAFEX1MAIL1.st.com ([10.75.90.1]) by SAFEX1HUBCAS1.st.com ([10.75.90.14]) with mapi; Thu, 31 Mar 2011 22:10:25 +0200 From: Michel METZGER To: Paul Koning Cc: "gdb@sourceware.org" Date: Thu, 31 Mar 2011 20:10:00 -0000 Subject: RE: Undefine python command Message-ID: <5B4CE209869C6A4797F5FAA0B348F0A0D9F183F47E@SAFEX1MAIL1.st.com> References: <5B4CE209869C6A4797F5FAA0B348F0A0D9F183F45F@SAFEX1MAIL1.st.com> <4A96DB50-64BB-48FC-8515-E5367E59BA29@dell.com> In-Reply-To: <4A96DB50-64BB-48FC-8515-E5367E59BA29@dell.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes 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: 2011-03/txt/msg00219.txt.bz2 Apparently this doesn't work for gdb commands defined in python. (Assuming I have a class HelloWorld that defines a new gdb command) (gdb) python c =3D HelloWorld() (gdb) hello-world Hello, World! (gdb) python del c (gdb) hello-world Hello, World! Michel. -----Original Message----- From: Paul Koning [mailto:paul_koning@dell.com]=20 Sent: Thursday, March 31, 2011 3:46 PM To: Michel METZGER Cc: gdb@sourceware.org Subject: Re: Undefine python command "del" is the way. def foo(): print "hello world" foo() hello world del foo foo() Traceback... NameError: name 'foo' is not defined. paul On Mar 31, 2011, at 3:27 PM, Michel METZGER wrote: > Hi, >=20 > Is there a way to remove a commands defined in Python? > I need to define specific commands depending on the type of binary being = debugged. It's not a problem for the first binary loaded,=20 > but if the user loads a new binary with 'file', I will need to remove som= e commands. >=20 > Thanks, >=20 > Michel.