ceremcem / build-freecad-asm3

Build FreeCAD Asm3 inside a Debian container and run from there.
6 stars 0 forks source link

best practices for debugging FreeCAD #17

Open wohltat opened 3 years ago

wohltat commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.