snare / voltron

A hacky debugger UI for hackers
MIT License
6.18k stars 414 forks source link

AttributeError: 'NoneType' object has no attribute 'adaptor_class' #95

Closed sskaje closed 8 years ago

sskaje commented 8 years ago

commit a9cc84f9681ff1fda28f316c70d932af6f54b187

OS X 10.10, installed by

python setup.py install

error:

(lldb) command script import /Library/Python/2.7/site-packages/voltron-0.1-py2.7.egg/dbgentry.py
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/voltron-0.1-py2.7.egg/dbgentry.py", line 148, in __lldb_init_module
    env_dict['cmd'] = VoltronLLDBCommand(debugger, env_dict)
  File "/Library/Python/2.7/site-packages/voltron-0.1-py2.7.egg/dbgentry.py", line 109, in __init__
    self.adaptor = self.pm.debugger_plugin_for_host('lldb').adaptor_class()
AttributeError: 'NoneType' object has no attribute 'adaptor_class'

Then I changed to load from git repo

(lldb) command script import ~/Work/voltron/dbgentry.py                                                                                                                                                                                       Traceback (most recent call last):
  File "/Users/sskaje/Work/voltron/dbgentry.py", line 148, in __lldb_init_module
    env_dict['cmd'] = VoltronLLDBCommand(debugger, env_dict)
  File "/Users/sskaje/Work/voltron/dbgentry.py", line 109, in __init__
    self.adaptor = self.pm.debugger_plugin_for_host('lldb').adaptor_class()
AttributeError: 'NoneType' object has no attribute 'adaptor_class'

I read plugin.py, and found if I change

    def debugger_plugin_for_host(self, host=None):
        """
        Find a debugger plugin that supports the debugger host.
        """
        return self.debugger_plugins[host]

to

    def debugger_plugin_for_host(self, host=None):
        """
        Find a debugger plugin that supports the debugger host.
        """
        return self._debugger_plugins[host]

This error is gone.

Then comes voltron status in lldb

(lldb) 
(lldb) voltron start
Usage: voltron <init|status|debug|update>
(lldb) voltron init
Registered stop-hook
(lldb) voltron status
Traceback (most recent call last):
  File "/Users/sskaje/Work/voltron/dbgentry.py", line 157, in lldb_invoke
    env_dict['cmd'].invoke(debugger, command, result, env_dict)
  File "/Users/sskaje/Work/voltron/dbgentry.py", line 122, in invoke
    self.handle_command(command)
  File "/Users/sskaje/Work/voltron/dbgentry.py", line 54, in handle_command
    self.status()
  File "/Users/sskaje/Work/voltron/dbgentry.py", line 75, in status
    summs = self.server.client_summary()
AttributeError: 'Server' object has no attribute 'client_summary'
snare commented 8 years ago

Something seems to be wrong with the installation.

If you install in dev mode with python setup.py develop it should work for now. I’ll take a look.

Thanks.

On 31 Dec 2015, at 8:17 pm, sskaje notifications@github.com wrote:

commit a9cc84f https://github.com/snare/voltron/commit/a9cc84f9681ff1fda28f316c70d932af6f54b187 OS X 10.10, installed by

python setup.py install error:

(lldb) command script import /Library/Python/2.7/site-packages/voltron-0.1-py2.7.egg/dbgentry.py Traceback (most recent call last): File "/Library/Python/2.7/site-packages/voltron-0.1-py2.7.egg/dbgentry.py", line 148, in lldb_init_module env_dict['cmd'] = VoltronLLDBCommand(debugger, env_dict) File "/Library/Python/2.7/site-packages/voltron-0.1-py2.7.egg/dbgentry.py", line 109, in __init self.adaptor = self.pm.debugger_plugin_for_host('lldb').adaptor_class() AttributeError: 'NoneType' object has no attribute 'adaptor_class' Then I changed to load from git repo

(lldb) command script import ~/Work/voltron/dbgentry.py Traceback (most recent call last): File "/Users/sskaje/Work/voltron/dbgentry.py", line 148, in lldb_init_module env_dict['cmd'] = VoltronLLDBCommand(debugger, env_dict) File "/Users/sskaje/Work/voltron/dbgentry.py", line 109, in __init self.adaptor = self.pm.debugger_plugin_for_host('lldb').adaptor_class() AttributeError: 'NoneType' object has no attribute 'adaptor_class' I read plugin.py, and found if I change

def debugger_plugin_for_host(self, host=None):
    """
    Find a debugger plugin that supports the debugger host.
    """
    return self.debugger_plugins[host]

to

def debugger_plugin_for_host(self, host=None):
    """
    Find a debugger plugin that supports the debugger host.
    """
    return self._debugger_plugins[host]

This error is gone.

Then comes voltron status in lldb

(lldb) (lldb) voltron start Usage: voltron <init|status|debug|update> (lldb) voltron init Registered stop-hook (lldb) voltron status Traceback (most recent call last): File "/Users/sskaje/Work/voltron/dbgentry.py", line 157, in lldb_invoke env_dict['cmd'].invoke(debugger, command, result, env_dict) File "/Users/sskaje/Work/voltron/dbgentry.py", line 122, in invoke self.handle_command(command) File "/Users/sskaje/Work/voltron/dbgentry.py", line 54, in handle_command self.status() File "/Users/sskaje/Work/voltron/dbgentry.py", line 75, in status summs = self.server.client_summary() AttributeError: 'Server' object has no attribute 'client_summary' — Reply to this email directly or view it on GitHub https://github.com/snare/voltron/issues/95.

snare commented 8 years ago

Re-fixed in a07393e8ae7ab960786126be554081edc70058f4

sskaje commented 8 years ago

it's ok now. but another error. I'll create a new issue with error message tomorrow at work