Permalink
Browse files

util: new .gdbinit.py file in the project root. This file is automati…

…cally invoked on debug session in omnet 4.3+
  • Loading branch information...
1 parent c0883f1 commit 1d63fe4cd0e728dbb93021b9bb26ce37c9c4d4ac @rhornig rhornig committed Dec 17, 2012
Showing with 12 additions and 44 deletions.
  1. +12 −0 .gdbinit.py
  2. +0 −44 misc/gdb/README
View
@@ -0,0 +1,12 @@
+import sys
+import os
+
+# add the pretty printer classes to the system class path
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))+"/misc/gdb")
+
+if 'register_inet_printers' in dir():
+ print 'inet pretty printers already initialized.'
+else:
+ from inet.printers import register_inet_printers
+ register_inet_printers(None)
+ print 'Pretty printers initialized: inet'
View
@@ -1,44 +0,0 @@
-Activating pretty printing in GDB for INET classes:
-
-Windows:
- //TODO
-
-Mac OS X:
- Mac OS comes with gdb 6.2 which does not support gdb pretty printers.
-
-Linux:
- This directory must be included in the python system path and the pretty printer
- classes must be registered before starting gdb. This can be done by creating
- or modify a '.gdbinit' file in the $HOME directory with the following content.
- Do not forget to edit the path to point to this directory.
-
-$HOME/.gdbinit:
---8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
-set unwindonsignal on
-
-python
-
-import sys
-
-
-#
-# other pretty printer initializations
-#
-
-
-# inet pretty printer BEGIN
-
-sys.path.insert(0, '/path/to/inet-dir/misc/gdb')
-
-if 'register_inet_printers' in dir():
- print 'inet pretty printers already initialized.'
-else:
- from inet.printers import register_inet_printers
- register_inet_printers(None)
- print 'Pretty printers initialized: inet'
-
-# inet pretty printer END
-
-
-end
---8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--

0 comments on commit 1d63fe4

Please sign in to comment.