Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

best practices for debugging FreeCAD #17

Open
wohltat opened this issue Mar 20, 2021 · 5 comments
Open

best practices for debugging FreeCAD #17

wohltat opened this issue Mar 20, 2021 · 5 comments
Labels
documentation enhancement New feature or request

Comments

@wohltat
Copy link

wohltat commented Mar 20, 2021

I'm looking for an easy setup to inspect the inner workings of FreeCAD while it is running.

I've seen the Debug Friendly Run(https://github.com/ceremcem/build-freecad-asm3/blob/master/debug-friendly-run.md)
Is this also possible from the host (like run-in-chroot.sh) or only inside the container?

Do you have any other recommendations for debugging?
What would be nice is setting breakpoints, stepping through the code and watch the variable values as they change.

I didn't find much on debugging concerning FreeCAD.
Is there some documentation already on that topic? How does your debugging setup look like?

@ceremcem
Copy link
Owner

Is this also possible from the host (like run-in-chroot.sh) or only inside the container?

Yes, it should be. Please try building in Debug mode and follow the instructions.

Do you have any other recommendations for debugging?

realthunder somehow manages to determine the issues by only looking at the traceback. That have been sufficient for whole this time. However:

What would be nice is setting breakpoints, stepping through the code and watch the variable values as they change.

...yes, I agree. I've never tried it, but it should be possible by running FreeCAD under gdb, like we do for embedded apps: https://github.com/aktos-io/mcu-debug. It's not intended for debugging a desktop application, but will give you some ideas. You can also see the cheatsheet.

@wohltat
Copy link
Author

wohltat commented Mar 24, 2021

I think it's a bit confusing that there are two copies of the same folder. One on the host and one in the container.
On the first run you can configure it on the host, but the second time it does not work anymore. I was wondering for some time why it kept on building the Release version even though i changed the config.sh.
From what i have seen, this is not mentioned in the instructions.

Furthermore, which files are updated if the git repo changes? Shouldn't the folder in the container be in sync with the host folder?

@ceremcem
Copy link
Owner

I think it's a bit confusing that there are two copies of the same folder. One on the host and one in the container.

I can't follow. Which folders are we talking about? build-freecad-asm3 repo?

I was wondering for some time why it kept on building the Release version even though i changed the config.sh.

Are you trying to change on the host? You are supposed to make any change within the container.

Let me try to make it clear: Root dir of this repo is meant to be run inside the container. The "tools" are meant to be invoked from the host.

@wohltat
Copy link
Author

wohltat commented Mar 24, 2021

I can't follow. Which folders are we talking about? build-freecad-asm3 repo?

Yes, build-freecad-asm3.

Let me try to make it clear: Root dir of this repo is meant to be run inside the container. The "tools" are meant to be invoked from the host.

Ok, this makes it clearer. Now i know, but it would be good to also have that distinction in the instruction / documentation, because it is not intuitive for newcomers. If i trigger the build process from the host, i think, it is reasonable to assume that it also uses the config file from the host.
Just to be sure i did understand it, if the build-freecad-asm3 repo changes. You have to git pull it twice. One time on the host for the tools and one time in the container for the rest?

You are supposed to make any change within the container.

This would be a good addition for the instructions.

@ceremcem
Copy link
Owner

Now i know, but it would be good to also have that distinction in the instruction / documentation, because it is not intuitive for newcomers.

I agree.

If i trigger the build process from the host, i think, it is reasonable to assume that it also uses the config file from the host.

Correct.

You have to git pull it twice. One time on the host for the tools and one time in the container for the rest?

That's also correct. Maybe (just maybe) we could add a mechanism to verify that both ends have the same version of build-freecad-asm3 repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants