def find_and_set_debugged_frame(self, frame, thread_id):
thread = threading._active[thread_id]<EOL>thread_name = thread.getName()<EOL>if (not self.settings['<STR_LIT>'] and<EOL>thread_name == Mthread.current_thread_name()):<EOL><INDENT>newframe = Mthread.find_debugged_frame(frame)<EOL>if newframe is not None:  frame = newframe<EOL>pass<EOL><DEDENT>self.stack, self.curindex = Mcmdproc.get_stack(frame, None,<EOL>self.proc)<EOL>self.proc.stack, self.proc.curindex = self.stack, self.curindex<EOL>self.proc.frame_thread_name = thread_name<EOL>return<EOL>
The dance we have to do to set debugger frame state to
        *frame*, which is in the thread with id *thread_id*. We may
        need to the hide initial debugger frames.