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

feat: add crash report for MS Windows #3313

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rodolforg
Copy link
Contributor

@rodolforg rodolforg commented Jan 21, 2024

related to #3308 #391

@rodolforg rodolforg force-pushed the crash-report branch 4 times, most recently from 7bb3240 to 6acb824 Compare January 21, 2024 03:31
@rodolforg
Copy link
Contributor Author

rodolforg commented Jan 21, 2024

It works for those who installed drmingw (script 1-setup-windows-msys2.sh should do it).
I didn't force-linked to drmingw, so, if not installed, Synfig Studio runs normally. It is dynamically linked to the library (as synfig modules are).

As I don't know CMake, I don't know how to change the install script to install the required DLLs (exchndl.dll, mgwhelp.dll, dbghelp.dll, dbgcore.dll, symsrv.dll, and symsrv.yes)
I didn't touch autotools either.

To make it a bit more clear:

  • Rerun 1-setup-windows-msys2.sh to install new dependency
  • Build with cmake for debug version
  • In MSYS shell, run the binary output/... folder.

@rodolforg
Copy link
Contributor Author

How to get clean binaries from debug build, with a separate file with debug symbols:

# create a file with debug symbols
objcopy --only-keep-debug "${binary}" "${debugdir}/${debugfile}"
# strip binary and add reference to possible debug file
objcopy  --strip-debug --strip-unneeded --add-gnu-debuglink="${debugdir}/${debugfile}" "${binary}"

This way, we can ship the binary files, without any debug info, as it takes so much space...
And then, after receive a crash report file, we can recover the backtrace, by having the :

  • debug binary; or
  • the strip binary in a folder and the debugfile in the folder (if any) mentioned in objcopy from previous shell commands.
    This will return the guilty lines:
# address is written in crash report
addr2line-drmingw -e ${binary} ${address}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant