This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Undefine python command


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]