You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2013/02/21 17:25:00 UTC

svn commit: r1448706 - /openoffice/trunk/main/solenv/inc/lldb4aoo.py

Author: hdu
Date: Thu Feb 21 16:24:59 2013
New Revision: 1448706

URL: http://svn.apache.org/r1448706
Log:
lldb4aoo: add mechanism to provide/advertise LLDB helper functions

Modified:
    openoffice/trunk/main/solenv/inc/lldb4aoo.py

Modified: openoffice/trunk/main/solenv/inc/lldb4aoo.py
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/inc/lldb4aoo.py?rev=1448706&r1=1448705&r2=1448706&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/inc/lldb4aoo.py (original)
+++ openoffice/trunk/main/solenv/inc/lldb4aoo.py Thu Feb 21 16:24:59 2013
@@ -17,6 +17,34 @@ def __lldb_init_module( dbg, dict):
 	# register a generic helper function for pimpl types
 	dbg.HandleCommand( 'type summary add -F %s.%s -v -C yes -n PIMPL %s' % ( __name__,'get_pimpl_info', ' '.join(pimpl_types)))
 
+	# add info about specific helper methods
+	# assume functions with docstrings are available for general consumption
+	helper_funcs = [v for (k,v) in globals().iteritems() if( not k.startswith('_') and callable(v) and v.__doc__)]
+	if helper_funcs:
+		print( 'Available AOO-specific helper functions:')
+		for hfunc in helper_funcs:
+			shortdesc = hfunc.__doc__.splitlines()[0]
+			print( '\t%s\t# "%s"' %(hfunc.__name__, shortdesc))
+		print( 'Run them with:')
+		for hfunc in helper_funcs[:4]:
+			print( '\tscript %s.%s()' %(__name__, hfunc.__name__))
+
+# some helpers for use from interactive LLDB sessions
+
+import lldb
+
+def add_breakpoints():
+	'Setup breakpoints useful for AOO debugging'
+	dbg = lldb.debugger
+	if dbg.GetNumTargets() == 0:
+		return
+	# the list of interesting function breakpoints
+	aoo_breakfn = ['main', '__cxa_call_unexpected', 'objc_exception_throw']
+	aoo_breakfn += ['__cxa_throw']
+	# register breakpoints for function basenames
+	for b in aoo_breakfn:
+		dbg.HandleCommand( 'breakpoint set -b ' + b)
+
 
 # local functions for use by the AOO-type summary providers