Recent

Author Topic: Loading symbol files  (Read 428 times)

440bx

  • Hero Member
  • *****
  • Posts: 4893
Loading symbol files
« on: October 23, 2024, 09:19:17 am »
Hello,

For the time being the following question is mostly to satisfy my curiosity.

Presume a utility exists that creates DWARF symbol information for Windows executables (including dlls) created with compilers that do not generate DWARF symbols for them, e.g, all Windows system dlls and programs distributed with Windows, e.g, ntdll.dll, kernelbase, Calc, WordPad, etc.

The problem is those module do not have a "gnu_debuglink" letting the debugger know there is an external symbol file and its location.

The question is: how much work would be required to add the capability of declaring the existence of DWARF symbol files for some system code (Windows dlls and programs in the Windows directories , i.e, system32, syswow64, etc) ?

At this time, the idea would be to create a ".dbg" file stored in a configurable directory (a symbol cache) where the file name is the GUID stored in the debug directory (which, most if not all, Windows dlls/programs have.)  Therefore, once the IDE knows the directory, it can look for the GUID and look for a file named <guid>.dbg in that directory and load DWARF symbols for the module if available (not available would not be an error.)

Does the above sound reasonable and feasible without requiring an inordinate amount of work ?

Thank you.




(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: Loading symbol files
« Reply #1 on: October 23, 2024, 10:00:15 am »
I haven't looked at how to retrieve the GUID, but assume it is trivial.
The loading should be trivial too.

The "most" work is passing the config around. That is just labour though, not skill.

The config would come From LazDebuggerFp, it then needs to be passed through several instances, to get to the loader. But so does the filename.

440bx

  • Hero Member
  • *****
  • Posts: 4893
Re: Loading symbol files
« Reply #2 on: October 23, 2024, 10:56:34 am »
I haven't looked at how to retrieve the GUID, but assume it is trivial.
Yes, that part is easy.  It's in the Debug Directory, debug type: codeview (which seems to always be the first descriptor.)

The "most" work is passing the config around. That is just labour though, not skill.

The config would come From LazDebuggerFp, it then needs to be passed through several instances, to get to the loader. But so does the filename.
Great.  It's good to know there are no real problems to implement it, just, as expected, some work. 

Thank you.  I needed to know that.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018