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

Rémi Bernon rbernon at codeweavers.com
Tue Jun 22 12:07:26 CDT 2021


On 6/22/21 7:00 PM, Zebediah Figura (she/her) wrote:
> On 6/21/21 2:33 PM, Rémi Bernon wrote:
>> To help gdb reload symbol files from /proc/<pid>/maps, making it
>> possible to load debug info for ELF and PE modules for Wine processes.
>>
>> When sourced (from ~/.gdbinit for instance), this adds a new
>> "load-symbol-files" command (with an "lsf" alias), which automatically
>> calls add-symbol-file on every mapped file that can be read as ELF or
>> PE, with the correct section offset.
>>
>> The command has to be run manually, for instance after executing for
>> a while, to load new modules that may have been loaded, as there's no
>> way for gdb to be notified of such changes automatically.
>>
>> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
>> ---
>>
>> This is some script I've been using for a while, and more or less broken
>> versions are also used by other people, so I figured maybe it would be
>> better to have a proper working version officially distributed with Wine
>> source instead, as it's pretty useful for debugging Wine under gdb.
>>
>> It's still a bit manual to use, as gdb cannot easily be notified of
>> dynamic library loading [1], but I think it's much better than having
>> nothing.
>>
>> [1] in theory there's ways to do it using systemtap probes, but it's
>> going to be hard to make it work, especially for PE modules.
> 
> I'm probably missing something, but why can't we just do it in response 
> to LOAD_DLL_DEBUG_EVENT?
> 

It's not for winedbg but when using gdb directly.
-- 
Rémi Bernon <rbernon at codeweavers.com>



More information about the wine-devel mailing list