DWARF debug info version on macOS and 'std::' namespace (and pretty-printers)
Philippe Blain
levraiphilippeblain@gmail.com
Sun Mar 7 23:10:54 GMT 2021
Hi,
Le 2021-03-07 à 11:08, Jonathan Wakely a écrit :
> On 07/03/21 08:09 +0000, Jonathan Wakely via Libstdc++ wrote:
>>> >
>>> > The code loops over libstdc++.* (i.e. using the shell's sorting rules)
>>> > and takes the last name that isn't a symlink and isn't a .la or .py
>>> > file. For ELF targets where we have these names, the last one is the
>>> > one we want to use:
>>> >
>>> > libstdc++.a
>>> > libstdc++.so
>>> > libstdc++.so.6
>>> > libstdc++.so.6.0.29
>>> >
>>> > But if you have these names:
>>> >
>>> > libstdc++.6.dylib
>>> > libstdc++.a
>>> >
>>> > then the last one is going to be the .a not the dylib.
>>> >
>>> > It shouldn't be *too* hard to fix that.
>>>
>>> I'll try to have a look into that.
>>>
>>> >
>>> > I wonder if this affects Windows too, and other targets that don't use
>>> > the ELF library naming scheme.
>>>
>>> I'm new to Windows, but I just installed MinGW-w64 (that includes GDB)
>>> to check. The *-gdb.py file for libstdc++ is actually at the following
>>> path:
>>>
>>> $installdir\lib\gcc\x86_64-w64-mingw32\8.1.0\libstdc++.dll.a-gdb.py
>>>
>>> but the actual dynamic library used in compiled programs (checked with
>>> "info shared" in GDB) is $installdir\bin\libstdc++-6.dll.
>>>
>>
>> Yep, so the wrong one.
>>
>>
>> However, the pretty printers do work because they install a global gdbinit
>>> at $installdir\etc\gdbinit with the following content:
>>>
>>
>> Hmm, that looks like a mingw-w64 workaround. It looks suboptimal, because
>> it assumes you only have one version of GCC in use.
>>
>> I'll try to fix the makefile so it does the right thing for Windows too.
>>
>> Thanks for bringing this to our attention.
>
> I've opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99453 for
> this problem installing the Python file.
I searched for other *-gdb.py files on my system and looked at the
build process for these projetcs, and found one interesting example
for libisl, where it looks like they rely on the libtool *.la file
to get the right name for the (shared or not) library:
https://repo.or.cz/isl.git/blob/HEAD:/Makefile.am#l611
Maybe something similar could be done.
I'll add that to the bugzilla entry once my account is created.
Philippe.
More information about the Libstdc++
mailing list