summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-10-20 12:06:34 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-10-20 12:09:12 -0700
commit2533cfb000ccf46174edd4cf9d99b19768e6fb00 (patch)
tree4bbd23b4da1b69c5f57d2c3217f92aa03863f302
parent41a63f4b3d4e5287af652a1b9d30c87980923d35 (diff)
downloadtmwa-2533cfb000ccf46174edd4cf9d99b19768e6fb00.tar.gz
tmwa-2533cfb000ccf46174edd4cf9d99b19768e6fb00.tar.bz2
tmwa-2533cfb000ccf46174edd4cf9d99b19768e6fb00.tar.xz
tmwa-2533cfb000ccf46174edd4cf9d99b19768e6fb00.zip
Fix gdb python stuff
-rw-r--r--src/main-gdb-head.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main-gdb-head.py b/src/main-gdb-head.py
index cfdce2b..394b6d7 100644
--- a/src/main-gdb-head.py
+++ b/src/main-gdb-head.py
@@ -7,11 +7,16 @@
# This lets us enumerate what *we* added.
initial_globals = set(globals())
+import re
+
def finish():
- diff = set(globals()) - initial_globals
+ global finish, initial_globals, FastPrinters
+
+ diff = set(globals()) - initial_globals \
+ - {'finish', 'initial_globals', 'FastPrinters'}
fp = FastPrinters()
+
# After this, don't access any more globals in this function.
- global finish, initial_globals, FastPrinters
del finish, initial_globals, FastPrinters
for k in diff:
@@ -20,6 +25,8 @@ def finish():
fp.add_printer(v)
gdb.current_objfile().pretty_printers.append(fp)
+ print('Added %d custom printers for %s'
+ % (len(fp.printers), gdb.current_objfile().filename))
class FastPrinters(object):
''' printer dispatch the way gdb *should* have done it