I've a recurrent problem. My breakpoints stop working (i.e. they get ignored). This seems to be correlated with how I move my code around. Specifically I work on a desktop and sometimes on a workspace off a usb on a laptop. To move code I copy the src folder over. I've been able to establish situations where on my USB workspace the breakpoint still works (on same code) even though that same breakpoint does not work on the same code on the desktop.
I think I was able to fix it once by rebuilding on the desktop the whole project (i.e. manually creating an new folder, copying code over etc).
Any idea what I might be doing by my process of moving src folder that gradually seems to destroy my breakpointing ability? I'm thinking some cache or index or other workspace specific context must be causing the issue.
I did try copying my full USB workspace over (where the breakpoint works) to desktop. But didn't resolve.
So two questions:
1) how might i fix the problem (otherwise debuggin becomes very hard)
2) is there some better way for me to move code between workspaces? Perhaps some kind of source control process or syncing process within eclipse?
Thanks!
Lin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, the common reason why that happens is that you're probably not copying only the source files, but also the .pyc files. When the .pyc file is compiled from a source file, it adds some info from your filesystem, and that info is not recreated unless the file actually changes (but it doesn't see that you moved the file around)... So, the debugger actually sees the wrong path because of that .pyc file.
If you clear the .pyc files, that should make it work (right click the source folder > pydev > clear .pyc files)
Another option is not copying the .pyc files.
Usually, when I have to move the code like you're doing, I use something a DVCS (e.g.: Mercurial), adding only the source files... (you could also always use it from the usb, mounting it with the same letter, so, you wouldn't have to copy it around because you'd always be working in the USB -- but you should have a version control system anyways).
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've a recurrent problem. My breakpoints stop working (i.e. they get ignored). This seems to be correlated with how I move my code around. Specifically I work on a desktop and sometimes on a workspace off a usb on a laptop. To move code I copy the src folder over. I've been able to establish situations where on my USB workspace the breakpoint still works (on same code) even though that same breakpoint does not work on the same code on the desktop.
I think I was able to fix it once by rebuilding on the desktop the whole project (i.e. manually creating an new folder, copying code over etc).
Any idea what I might be doing by my process of moving src folder that gradually seems to destroy my breakpointing ability? I'm thinking some cache or index or other workspace specific context must be causing the issue.
I did try copying my full USB workspace over (where the breakpoint works) to desktop. But didn't resolve.
So two questions:
1) how might i fix the problem (otherwise debuggin becomes very hard)
2) is there some better way for me to move code between workspaces? Perhaps some kind of source control process or syncing process within eclipse?
Thanks!
Lin
I neglected to mention I am on 1.4.5 builds. I have pydev extensions as well as open source.
Hi,
Well, the common reason why that happens is that you're probably not copying only the source files, but also the .pyc files. When the .pyc file is compiled from a source file, it adds some info from your filesystem, and that info is not recreated unless the file actually changes (but it doesn't see that you moved the file around)... So, the debugger actually sees the wrong path because of that .pyc file.
If you clear the .pyc files, that should make it work (right click the source folder > pydev > clear .pyc files)
Another option is not copying the .pyc files.
Usually, when I have to move the code like you're doing, I use something a DVCS (e.g.: Mercurial), adding only the source files... (you could also always use it from the usb, mounting it with the same letter, so, you wouldn't have to copy it around because you'd always be working in the USB -- but you should have a version control system anyways).
Cheers,
Fabio
thank you for the good advice.