'Get number of frames in backtrace
Args:
- sp: stack pointer address, for caching (Int)
Returns:
- depth: number of frames (Int)'

@memoized
def backtrace_depth(self, sp=None):

    backtrace = self.execute_redirect('backtrace')
    return backtrace.count('#')
