[PATCH] tools: Add gdbinit helper with LoadSymbolFiles command.

Bernhard Übelacker bernhardu at mailbox.org
Sun Jan 23 16:18:19 CST 2022


Am 28.06.21 um 23:22 schrieb Bernhard Übelacker:
> Am 28.06.21 um 13:27 schrieb Rémi Bernon:
>> On 6/24/21 10:50 PM, Bernhard Übelacker wrote:
>>> Hello Rémi,
>>> I was trying to do similar with rr-debugger [1] to load symbols
>>> iterating over mapped files, but it never got into a really got state.
>>>
>>> But with a little modification (patch attached), your script does
>>> the same and is way less complicated.
>>>
>>> I noted just one issue while testing a little with
>>> notepad.exe, with plain gdb and rr:
>>>
>>> Sections other than .text of ELF libraries get mapped to address 0x0.
>>> (Could you see this too in 'info target'?)
>>> This combined with a kind of huge .data section of shell32.dll.so
>>> overlaps then with .text of notepad.exe, therefore gdb shows then
>>> in a backtrace not the right symbols.
>>> The other attached patch tries to also map the data section to resolve
>>> this. But I am not sure if other sections should also be mapped.
>>>
>>> Thanks for sharing.
>>>
>>> Kind regards,
>>> Bernhard
>>>
>>> [1] https://github.com/rr-debugger/rr/pull/2810
>>>
>>
>> Hi Bernhard,
>>
>> Thanks for the feedback, I've also tried rr in the past, without much 
>> success so far, but I'd love to be able to use it with Wine. On Intel, 
>> gdb supports branch trace record, which has been very, very, 
>> convenient to debug Wine issues but I'm now on AMD and I'm missing it 
>> a bit.
>>
>> I haven't looked into the issue you mentioned, and I think I've seen a 
>> few cases where the debug symbols were off, but in general it's been 
>> working well enough. I'll try to have a better look.
>>
>> Cheers,
> 
> 
> Hello Rémi,
> recording wine worked for me just when all wine processes are
> inside the recording. Otherwise some modifications through e.g. mapped
> memory does not get recorded (e.g. user_shared_data) which may lead when
> replaying to wrong register values, as these modifications are missing.
> Unfortunately this makes it kind of slow.
> (Maybe at least wineserver and the desired process have to be in the
> recording ... if modifications are just one way from wineserver
> to other processes ... but that makes preparing the session ugly.)
> 
> And I am using it with AMD, but so called "SBB mitigation" is required.
> I am using the kernel module: https://github.com/rr-debugger/rr/wiki/Zen
> 
> Kind regards,
> Bernhard


Hello Rémi,
just a small update, sorry for the late reply.

I sometimes got an issue with some sections placed
automatically by gdb to some location where they did not belong.
Therefore, as far as I remember, I changed it to trying to map all 
sections of a file, which worked in these cases better for me.


There is also another maybe interesting thing related to this area.
Keno Fischer created a prototype of gdb being able to iterate the
list of dlls itself with just a few modifications,
which can be used standalone or with rr also.
(Currently just 64-bit.)

https://github.com/JuliaComputing/gdb-solib-wine


Kind regards,
Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdbinit.py
Type: text/x-python
Size: 4276 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220123/0e215271/attachment.py>


More information about the wine-devel mailing list