I can't get a stack trace with symbol information from an
exe file and tracked the problem down to this.
dbghelp tries to load the symbols for the executable file
by looking up the file name without the .exe extension and
fails because the file is not found. This patch adds the
.exe back on to the file name and tries to look it up again
before failing.
I doubt this is the right solution but it works for me.
--- pe_module.c 2005-03-01 06:20:19.000000000 -0500
+++ /mnt/floppy/pe_module.c 2005-03-04 11:06:30.000000000 -0500
@@ -332,6 +332,7 @@
HANDLE hMap;
void* mapping;
char loaded_name[MAX_PATH];
+ TRACE("(%p %s %p %08lx %08lx)\n", pcs, name, hFile, base, size);
loaded_name[0] = '\0';
if (!hFile)
@@ -341,13 +342,22 @@
/* FIXME SetLastError */
return NULL;
}
- if ((hFile = FindExecutableImage(name, NULL, loaded_name)) == NULL)
- return NULL;
+ if ((hFile = FindExecutableImage(name, NULL, loaded_name)) == NULL) {
+ char full_name[MAX_PATH];
+ TRACE("file: %s not found\n", name);
+ strcpy(full_name, name);
+ strcat(full_name, ".exe");
+ if ((hFile = FindExecutableImage(full_name, NULL, loaded_name)) == NULL) {
+ TRACE("file: %s not found\n", full_name);
+ return NULL;
+ }
+ }
opened = TRUE;
}
else if (name) strcpy(loaded_name, name);
else if (dbghelp_options & SYMOPT_DEFERRED_LOADS)
FIXME("Trouble ahead (no module name passed in deferred mode)\n");
+ TRACE("loaded_name = %s\n", loaded_name);
if (!(module = module_find_by_name(pcs, loaded_name, DMT_PE)) &&
(hMap = CreateFileMappingA(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
{