Undefine python command

Michel METZGER michel.metzger@st.com
Thu Mar 31 20:10:00 GMT 2011


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 = 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] 
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,
> 
> 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, 
> but if the user loads a new binary with 'file', I will need to remove some commands.
> 
> Thanks,
> 
> Michel.



More information about the Gdb mailing list