My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 40: [drmingw] Patch to add support for reading debug symbols from external files to exchndl.dll
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by daniel.a...@gmail.com, Aug 28, 2010
Currently, exchndl will read only stabs debugging symbols directly from the relevant modules.

This patch adds the additional ability to read debug symbols from files that exist alongside the modules.  This makes it possible to generate useful crash reports from stripped binaries by reading the symbols from a unstripped copy of the binary.

If the module has version information embedded, a comparison is done to make sure that the corresponding "debug symbols" module has the same version information specified.

By default, it only looks for a "module.ext.dbgsym" file in the same directory as the module.

An alternate directory structure for looking up debug symbols can be specified by calling "SetDebugInfoDir" on the loaded exchndl.dll instance.  The DebugInfoDir is intended to be a parallel directory structure to the stripped application structure containing the corresponding ".dbgsym" files.

For Example:
...\Application\app.exe
...\Application\applib.dll
...\Application\plugins\plugin.dll

The DebugInfoDir looks like this:
...\Application\dbgsym-1.0.1.1\app.exe.dbgsym
...\Application\dbgsym-1.0.1.1\applib.dll.dbgsym
...\Application\dbgsym-1.0.1.1\plugins\plugin.dll.dbgsym

The following code sets up the DebugInfoDir:

if ((hmod = LoadLibraryW(L"exchndl.dll"))) {
	FARPROC proc;
	char debug_dir[MAX_PATH];
	proc = GetProcAddress(hmod, "SetDebugInfoDir");
	if (proc) {
		_snprintf(debug_dir, sizeof(debug_dir) / sizeof(char),
			"%s\\dbgsym-%s", app_install_dir,  VERSION);
		debug_dir[sizeof(debug_dir) / sizeof(char) - 1] = '\0';
		printf(" Setting exchndl.dll DebugInfoDir to %s\n",
			debug_dir);
		(proc)(debug_dir);
	}
}

In my use case, I distribute stripped modules and then have a separate zip file that can be later extracted to the DebugInfoDir location if needed to help get a useful crash report.

This patch contains (and is a superset of) the patch in id 39.
exchndl_DebugInfoDir.patch
6.2 KB   View   Download
Apr 8, 2013
Project Member #1 Jose.R.F...@gmail.com
(No comment was entered for this change.)
Summary: [drmingw] Patch to add support for reading debug symbols from external files to exchndl.dll (was: Patch to add support for reading debug symbols from external files to exchndl.dll)
Sign in to add a comment

Powered by Google Project Hosting