2 Replies
      Latest reply on Jan 18, 2020 2:27 AM by msmialko
      msmialko Level 1 Level 1 (0 points)

        I wrote a script that adds a lot of breakpoints to my iOS project. Each breakpoint has a command that calls some logging code and continues without stopping.

        During my project execution, those breakpoints are called dozens if not hundreds times a second. Unfortunately, app performance collapsed after adding those breakpoints. It's pretty much unresponsive as executing breakpoints slow things down.

         

        Is this normal? Is performance cost for breakpoints so significant?

        I'm pasting below part of my python script from ~/.lldb:

         

        ...
        for funcName in funcNames:
          breakpointCommand = f'breakpoint set -n {funcName} -f {fileName}'
          lldb.debugger.HandleCommand(breakpointCommand)
          lldb.debugger.HandleCommand('breakpoint command add --script-type python --python-function devTrackerScripts.breakpoint_callback')
        

        def breakpoint_callback(frame, bp_loc, dict):
           lineEntry = frame.GetLineEntry()
           functionName = frame.GetDisplayFunctionName()
           expression = f'expr -- proofLog(lineEntry: "{lineEntry}", function: "{functionName}")'
        
           lldb.debugger.HandleCommand(expression)
        
           return False