Coder Social home page Coder Social logo

Comments (6)

JesusFreke avatar JesusFreke commented on May 14, 2024 1

Hmm. I don't think I've run into that. But I think I do have some pending fixes that I never got around to pushing. I'll check that today and get those pushed and released, and then let's see if it works for you with the new version.

from fusionidea.

JesusFreke avatar JesusFreke commented on May 14, 2024 1

This should be fixed by 836187a. Thanks for digging into it and suggesting the fix!

from fusionidea.

Bonjour123 avatar Bonjour123 commented on May 14, 2024

Ok thank you !
I'll let you know if it get fixed

from fusionidea.

JesusFreke avatar JesusFreke commented on May 14, 2024

I just looked at the pending changes I made, and it won't have any effect on the behavior you're seeing.

I just tried that myself and can reproduce the issue. I've actually ran into that before and tried to figure out what was causing it, but haven't had any success. I think it's probably something deep in the bowels of the integration of pydevd and IDEA/PyCharm.

You should still be able to debug though. Just resume execution from that initial breakpoint, and it should continue as normal.

from fusionidea.

Bonjour123 avatar Bonjour123 commented on May 14, 2024

So I've just ignored this bug untill now, when it really bothered me. I might have actually found the trick.
Copy C:\Users\[USER]\AppData\Roaming\JetBrains\PyCharm2022.1\plugins\fusion_idea\lib\pydevd-1.9.0\pydevd_attach_to_process\attach_script.py to the location of fusion_idea_addin
This allows us to make a relative import of it inside fusion_idea_addin.py by replacing import attach_script by from . import attach_script

Relative imports are important because otherwise the imported modules won't be reloaded inside Fusion360 python interpreter, and you would have to restart Fusion360 to see the changes in the imported modules.

Then, still in fusion_idea_addin.py, inside the attach function, replace the call to pydevd.settrace by:

    pydevd.settrace(
            port=port,
            host=host,
            stdoutToServer=True,
            stderrToServer=True,
            overwrite_prev_trace=True,
            suspend=True,
            trace_only_current_thread=False,
            patch_multiprocessing=False,
            stop_at_frame = False
        )

Notice the suspend=True, and stop_at_frame = False

While this is the only way I found to make it NOT stop inside attach_script.py, this is completely incoherent with the settrace sources:
suspend=True is supposed to actually simulate a breakpoint on settrace call, whereas the contrary happens

and stop_at_frame's default is supposed to be False, whereas explicitly setting it as False changes the function's behavior).

from fusionidea.

JesusFreke avatar JesusFreke commented on May 14, 2024

Hmm. Do relative imports cause the module to be reloaded? I don't think that's the case? But I could be wrong. I do jump through some hoops elsewhere to ensure, e.g. the script module is reloaded.

But in any case, I'll give it a shot, and merge it in if it looks like it fixes the issue.

Thanks for investigating!

from fusionidea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.