darkjames
Joined: 23 Dec 2009 Posts: 1
|
Posted: Sat Dec 26, 2009 6:51 pm Post subject: Demangling Python script for gdb |
|
|
Since gdb 7.0 there's support for Python scripts.
For now it's quite basic, but they have big plans: http://sourceware.org/gdb/wiki/PythonGdb...
I created one script to demangle D names (no types - just function name)
You can download it from http://szara.chmurka.net/gdbdbt.py
Sample below (generated by ldc-x86_64)
gdb backtrace:
Code: |
(gdb) bt
#0 makecontext () from /lib/libc.so.6
#1 _D5tango4core6Thread5Fiber9initStackMFZv ()
#2 _D5tango4core6Thread5Fiber5_ctorMFDFZvmZC5tango4core6Thread5Fiber ()
#3 _D10fiber_test11__unittest7FZv () at fiber_test.d:493
#4 _D10fiber_test10__unittestZ ()
#5 _D5tango4core7Runtime18runModuleUnitTestsUZb14__foreachbody1MFKC10ModuleInfoZi ()
#6 _D6object10ModuleInfo7opApplyFDFKC10ModuleInfoZiZi ()
#7 runModuleUnitTests ()
#8 _D6dmain24mainUiPPaPPaZi6runAllMFZv ()
#9 _D6dmain24mainUiPPaPPaZi7tryExecMFDFZvZv ()
#10 main ()
|
backtrace from script:
Code: |
(gdb) dbt
#0 7ffff7208f50 in makecontext ()
#1 00408b5a in .tango.core.Thread.Fiber.initStack ()
#2 0040813c in .tango.core.Thread.Fiber._ctor ()
#3 00403617 in .fiber_test.__unittest7 ()
#4 00405317 in .fiber_test.__unittest ()
#5 00416445 in .tango.core.Runtime.runModuleUnitTests ()
#6 00410aa5 in .object.ModuleInfo.opApply ()
#7 004163a4 in runModuleUnitTests ()
#8 00412a9b in .dmain2.main ()
#9 004129ab in .dmain2.main ()
#10 00412941 in main ()
|
|
|