def dylan_break_gf(debugger, command, result, internal_dict): command_args = shlex.split(command) usage = 'usage: %prog [gf]' description = 'Set a breakpoint that covers every method on the generic function.' parser = optparse.OptionParser(description=description, prog='dylan-break-gf', usage=usage) try: (options, args) = parser.parse_args(command_args) except: return target = debugger.GetSelectedTarget() for arg in args: try: (binding, module, library) = utils.parse_binding(arg) symbol_name = mangling.dylan_mangle_binding( binding, module, library) except utils.InvalidBindingIdentifier: print 'Invalid binding name: %s' % arg continue expression = '(dylan_value)&%s' % symbol_name gf = target.CreateValueFromExpression(symbol_name, expression) if gf.GetError().Fail(): print "No generic function %s was found." % arg continue methods = dylan_generic_function_methods(gf) ieps = [dylan_method_iep_function(m) for m in methods] # Create a breakpoint for each IEP rather than a single one for # all IEPs since there isn't an appropriate typemap in the SWIG # bindings for SBTarget::BreakpointCreateByNames(). for iep in ieps: target.BreakpointCreateByName(iep.name) print "Set breakpoints on %d entry points." % len(ieps)
def dylan_break_gf(debugger, command, result, internal_dict): command_args = shlex.split(command) usage = 'usage: %prog [gf]' description = 'Set a breakpoint that covers every method on the generic function.' parser = optparse.OptionParser(description=description, prog='dylan-break-gf', usage=usage) try: (options, args) = parser.parse_args(command_args) except: return target = debugger.GetSelectedTarget() for arg in args: try: (binding, module, library) = utils.parse_binding(arg) symbol_name = mangling.dylan_mangle_binding(binding, module, library) except utils.InvalidBindingIdentifier: print 'Invalid binding name: %s' % arg continue expression = '(dylan_value)&%s' % symbol_name gf = target.CreateValueFromExpression(symbol_name, expression) if gf.GetError().Fail(): print "No generic function %s was found." % arg continue methods = dylan_generic_function_methods(gf) ieps = [dylan_method_iep_function(m) for m in methods] # Create a breakpoint for each IEP rather than a single one for # all IEPs since there isn't an appropriate typemap in the SWIG # bindings for SBTarget::BreakpointCreateByNames(). for iep in ieps: target.BreakpointCreateByName(iep.name) print "Set breakpoints on %d entry points." % len(ieps)
def dylan_break_gf(debugger, command, result, internal_dict): command_args = shlex.split(command) usage = 'usage: %prog [gf]' description = 'Set a breakpoint that covers every method on the generic function.' parser = optparse.OptionParser(description=description, prog='dylan-break-gf', usage=usage) try: (options, args) = parser.parse_args(command_args) except: return # We use a dummy_value here rather than SBTarget::CreateValueFromExpression # because the SBTarget method isn't in shipping xcode yet. target = debugger.GetSelectedTarget() dummy_value = target.FindFirstGlobalVariable("KPtrueVKi") for arg in args: try: (binding, module, library) = utils.parse_binding(arg) symbol_name = mangling.dylan_mangle_binding( binding, module, library) except InvalidBindingException: print 'Invalid binding name: %s' % arg continue gf = dummy_value.CreateValueFromExpression("gf", symbol_name) if not gf.IsValid(): print "No generic function %s was found." % arg continue if not gf.GetType().IsPointerType(): gf = gf.address_of methods = dylan_generic_function_methods(gf) ieps = [dylan_method_iep_function(m) for m in methods] # Create a breakpoint for each IEP rather than a single one for # all IEPs since there isn't an appropriate typemap in the SWIG # bindings for SBTarget::BreakpointCreateByNames(). for iep in ieps: target.BreakpointCreateByName(iep.name)
def dylan_break_gf(debugger, command, result, internal_dict): command_args = shlex.split(command) usage = 'usage: %prog [gf]' description = 'Set a breakpoint that covers every method on the generic function.' parser = optparse.OptionParser(description=description, prog='dylan-break-gf', usage=usage) try: (options, args) = parser.parse_args(command_args) except: return # We use a dummy_value here rather than SBTarget::CreateValueFromExpression # because the SBTarget method isn't in shipping xcode yet. target = debugger.GetSelectedTarget() dummy_value = target.FindFirstGlobalVariable("KPtrueVKi") for arg in args: try: (binding, module, library) = utils.parse_binding(arg) symbol_name = mangling.dylan_mangle_binding(binding, module, library) except InvalidBindingException: print 'Invalid binding name: %s' % arg continue gf = dummy_value.CreateValueFromExpression("gf", symbol_name) if not gf.IsValid(): print "No generic function %s was found." % arg continue if not gf.GetType().IsPointerType(): gf = gf.address_of methods = dylan_generic_function_methods(gf) ieps = [dylan_method_iep_function(m) for m in methods] # Create a breakpoint for each IEP rather than a single one for # all IEPs since there isn't an appropriate typemap in the SWIG # bindings for SBTarget::BreakpointCreateByNames(). for iep in ieps: target.BreakpointCreateByName(iep.name)