Open PierreMarieBaty opened 8 months ago
Also a stack trace display improvement that will affect Linux as well, in src/harness/os/linux.c line 66
sprintf(addr2line_cmd, "addr2line -f -p -e \"%s\" %p", program_name, addr - get_dethrace_offset()); // Pierre-Marie Baty -- support pathnames containing spaces
Replacing %.256s with "%s" ensures addr2line doesn't fail for programs whose full pathname contains spaces (e.g. located in "~/Documents/My Stuff/Some Path/Containing spaces/...").
BTW, looking good: https://i.postimg.cc/qM1V6C53/temp-Imagehx1-Pj4.jpg
Also, src/harness/harness.c
must be linked against libexecinfo
on FreeBSD:
target_link_libraries(harness PRIVATE execinfo)
(Tested with 0.6.0.)
Actually there's a bit more. I don't use the CMake system, but in my bourne shell build script, I have this:
test "$(uname)" = "FreeBSD" && LDFLAGS="-linotify -lusbhid -lexecinfo ${LDFLAGS}"
(libinotify and libusbhid are dependencies of the FreeBSD SDL2 package.)
You might want to add these too.
Message ID: @.***>
What functions, provided by execinfo, is dethrace using?
About your shell script, I suppose you're linking with $(pkg-config --libs sdl2)
?
https://man.freebsd.org/cgi/man.cgi?query=backtrace&sektion=3&manpath=FreeBSD+11-current
backtrace() and backtrace_symbols() aren’t in the libc on FreeBSD but in that library.
I don’t use pkg-config either in my build script. It’s very short and crude. The library list is hardcoded per system. Dethrace is a simple enough project to avoid depending on complex and failure-prone build systems. I’m rather a "living off the land" partisan.
libinotify and libusbhid are dependencies of the FreeBSD SDL2 package.
Not necessarily, depends on your SDL2 build options.
That's if you rebuild from /usr/ports. But these are the default options, and the precompiled version that you get by "pkg add" installs a libsdl2 with these dependencies. But that's nitpicking :)
Message ID: @.***>
In src/BRSRC13/CORE/STD/brstdfile.c line 91
in src/BRSRC13/CORE/V1DB/enables.c line 178
in src/harness/include/harness/winsock.h line 25, add
After these fixes, dethrace compiles successfully on FreeBSD/arm64 FWIW.