jaredly / vim-debug

A plugin for VIM that creates an Integrated Debugging Environment :) Currently works with PHP and Python
http://jaredforsyth.com/projects/vim-debug
MIT License
284 stars 28 forks source link

Installation instructions? #2

Closed reckoner closed 14 years ago

reckoner commented 14 years ago

Can you provide some installation instructions for this? It seems like there are further Python dependencies that are not explicitly mentioned.

jaredly commented 14 years ago

I'm just writing that up now :) I've put the package on pypi, so it's not difficult.

What dependency did you run into? (If it's gconf, I just removed it)

jaredly commented 14 years ago

And here you go: http://jaredforsyth.com/blog/2010/jul/16/installing-vim-debug/

reckoner commented 14 years ago

thanks. However, I'm on Windows and I can't even figure out what the corresponding command is for

sudo pip install dbgp

In other words, I don't know how to install dbgp ( or even where to get it ).

thanks.

jaredly commented 14 years ago

Ah. sorry about that ;) dbgp is available on pypi

http://pypi.python.org/pypi/dbgp

But I can't guarantee It'll work on windows -- I don't know how well vim on windows works

reckoner commented 14 years ago

thanks. I'm trying to get it to work on Windows. I pulled down the latest git,but I cannot find debugger.vim in it and I still see a gconf dependency in the Python code.

thanks.

jaredly commented 14 years ago

There is an "install-vim-debug.py" script that gets installed w/ vim-debug (if you do easy_install vim-debug or setup.py install) which creates the debugger.vim file.

Try pulling the latest git again -- I just realized I had local changes [the gconf dependency should be optional, behond a try/catch ImportError]

reckoner commented 14 years ago

I got this far until:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Python26\lib\site-packages\vim_debug\commands.py", line 39, in debugger_cmd
      if debugger.bend.connected():
  AttributeError: Debugger instance has no attribute 'bend'    

there are a couple of tweaks to the setup to get debugger.vim created, but those are minor.

jaredly commented 14 years ago

Ok, looks like the debug backend failed to start...

of course, that makes sense -- I've assumed that "pydbgp.py" is a valid shell command...which it isn't in windows. I'll have to look into it.

reckoner commented 14 years ago

actually, I think it's deeper than that. I made the following change to new_debugger

       subprocess.Popen(('c:\Python26\python','pydbgp.py', '-d', 'localhost:9000',   fname), stdout=subprocess.PIPE, stderr=subprocess.PIPE)

so there is no problem starting the script. There's something else happening after that. Is there a way to separately debug the pydbgp.py script?

jaredly commented 14 years ago

That shouldn't fix it -- windows still has no idea where "pydbgp.py" is...right?

Anyway, you can start pydbgp manually on the command line, and then in vim start it w/ :Dbg -

reckoner commented 14 years ago

I gave it the full path to pydbgp.py and it fired a second python process. I have a new error:

     E486: Pattern not found: test.py
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Python26\lib\site-packages\vim_debug\commands.py", line 40, in debugger_cmd
      debugger.bend.command(cmd['function'])
    File "C:\Python26\lib\site-packages\vim_debug\dbgp.py", line 37, in command
      self.get_packets()
    File "C:\Python26\lib\site-packages\vim_debug\dbgp.py", line 68, in get_packets
      self.handlers['<init>'](packet)
    File "C:\Python26\lib\site-packages\vim_debug\new_debugger.py", line 284, in _init
   self.ui.set_srcview(file, 1)
    File "C:\Python26\lib\site-packages\vim_debug\ui.py", line 181, in set_srcview
      vim.command('silent edit! ' + file)
     vim.error        

Note that I made sure that the antivirus/firewall was not blocking it. The 'test.py' file that it is referring to is a simple test Python script that I'm using to test this.

jaredly commented 14 years ago

Oh dear. listen, I'll have to tackle this on monday. you're on cygwin, you said? I've got a virtualized winxp I can fire up and test things out.

reckoner commented 14 years ago

Actually, I'm not on cygwin. Note that all of the errors refer to c:\Python26, which is not cygwin.

Thanks for all the effort. No rush.

curiale commented 11 years ago

Hi Jared,

I've been having problems to launch or start a new debuger. I could solve this problem adding the parameter shell=True to the call of the Popen into the function start_py in the file new_debugger.py (line 121).

I was setting properly the location of the pydbgp.py into the PATH but the plugin could find it. After add this parameter to the Popen call, the plugin works fine.

jaredly commented 11 years ago

Oh good to know, thanks for the report. I'll get that fix into master tomorrow

"Ariel Hernán Curiale" notifications@github.com wrote:

Hi Jared,

I've been having problems to launch or start a new debuger. I could solve this problem adding the parameter shell=True to the call of the Popen into the function start_py in the file new_debugger.py (line 121).

I was setting properly the location of the pydbgp.py into the PATH but the plugin could find it. After add this parameter to the Popen call, the plugin works fine.


Reply to this email directly or view it on GitHub: https://github.com/jaredly/vim-debug/issues/2#issuecomment-22827181

Sent from my Android device with K-9 Mail. Please excuse my brevity.