On Fri Nov 15 08:08:11 2024 +0000, Chih-Hsuan Yen wrote:
Thank you very much for this patch! I managed to get separate debug files working. Besides this merge request, [pacman](https://gitlab.archlinux.org/yan12125/pacman/-/commits/pe-symbols) and [wine package](https://gitlab.archlinux.org/archlinux/packaging/packages/wine/-/tree/strip-...) changes are also needed. At the pacman side, I need to [skip creation of some symlinks](https://gitlab.archlinux.org/yan12125/pacman/-/commit/0a0c5dc57d685c58715519...). I'm not sure what's the purpose of `/usr/lib/debug/.build-id/xxx/yyy` links (those that do not end with `.debug`) for ELF files, and apparently they confuse dbghelp. At the wine package side, I need to replace `-g` in `CROSSCFLAGS` and `CROSSCXXFLAGS` with `-gdwarf-4`. I understand that wine supports up to DWARF 4, while I remember wine automatically used `-gdwarf-4` when given `-g` some time ago. If this is an intended change, maybe documenting it somewhere is good.
if binutils isn't compiled with PE support (this is apparently the
Arch case) To clarify, I was not sure if it's okay to just use binutils instead of mingw-w64-binutils. It seems fine after more testing.
At the pacman side, I need to [skip creation of some symlinks](https://gitlab.archlinux.org/yan12125/pacman/-/commit/0a0c5dc57d685c58715519...). I'm not sure what's the purpose of `/usr/lib/debug/.build-id/xxx/yyy` links (those that do not end with `.debug`) for ELF files, and apparently they confuse dbghelp.
That's not the intent. Something must be wrong somewhere. In the link to patched strip.sh.in file, the call to package_source_file is meant to be done in both elf and pe cases. It's not clear to me if you did your tests with that part active or not.
The generic idea I'm pushing for is to maximize the sharing of code betwen elf and pe cases. So what I would do for the changes in strip.sh.in: - don't pass an additional binary_type variable - keep the fallback from readelf -h in tidy_script() to add PE files for calling collect_debug_symbols - don't change collect_debug_symbols() - in build_id(); if readelf fails, fallback to reading the buildid with objcopy
At the end, running wine with WINEDEBUG=+dbghelp should give you the actual path the split debuginfo is read from (and it should be from /usr/lib/debug/.build_id)
At the wine package side, I need to replace `-g` in `CROSSCFLAGS` and `CROSSCXXFLAGS` with `-gdwarf-4`. I understand that wine supports up to DWARF 4, while I remember wine automatically used `-gdwarf-4` when given `-g` some time ago. If this is an intended change, maybe documenting it somewhere is good.
No, that's not intended, and the expected behavior is what you describe (CROSSCFLAGS=-g should end up with -gdwarf-4). But I can't repro here. Could you share your configure options? Maybe I didn't retest with your combination.