FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Demangling Python script for gdb

 
Post new topic   Reply to topic     Forum Index -> GDB Patches
View previous topic :: View next topic  
Author Message
darkjames



Joined: 23 Dec 2009
Posts: 1

PostPosted: Sat Dec 26, 2009 6:51 pm    Post subject: Demangling Python script for gdb Reply with quote

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 Smile (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 ()
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> GDB Patches All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group