コード例 #1
0
 def bt(self):
     """ Print an improved backtrace. """
     for i, frame in enumerate(self.thread.frames):
         row = ''
         row += html_to_ansi(
             f'<span style="color: cyan">0x{frame.addr.GetFileAddress():x}</span> '
         )
         row += str(frame)
         if i == 0:
             # first line
             row += ' 👈'
         print(row)
コード例 #2
0
    def interactive(self):
        """ Start an interactive Hilda shell """
        if not self._dynamic_env_loaded:
            self.init_dynamic_environment()
        self._globalize_commands()
        print('\n')
        self.log_info(html_to_ansi(GREETING))

        c = Config()
        c.IPCompleter.use_jedi = False
        c.InteractiveShellApp.exec_lines = [
            '''IPython.get_ipython().events.register('pre_run_cell', self._ipython_run_cell_hook)'''
        ]
        namespace = globals()
        namespace.update(locals())

        IPython.start_ipython(config=c, user_ns=namespace)