Allow several -I parameters to be given - currently just the last is
used. Remove obvious wrong binaries when searching for the definition
of a functions definition. Really just strip a '.dll' extension and
not also '.dll.foorbar.spec'.
diff --git a/tools/winedump/main.c b/tools/winedump/main.c
index 315249d..d92d011 100644
--- a/tools/winedump/main.c
+++ b/tools/winedump/main.c
@@ -27,16 +27,24 @@
static void do_include (const char *arg)
{
- globals.directory = arg;
+ char *newIncludes;
+
+ if (!globals.directory)
+ globals.directory = strdup(arg);
+ else {
+ newIncludes = str_create (3,globals.directory," ",arg);
+ free(globals.directory);
+ globals.directory = newIncludes;
+ }
globals.do_code = 1;
}
static inline const char* strip_ext (const char *str)
{
- char *ext = strstr(str, ".dll");
- if (ext)
- return str_substring (str, ext);
+ int len = strlen(str);
+ if (len>4 && strcmp(str+len-4,".dll") == 0)
+ return str_substring (str, str+len-4);
else
return strdup (str);
}
@@ -193,7 +201,7 @@
{"-t", SPEC, 0, do_trace, "-t TRACE arguments (implies -c)"},
{"-f", SPEC, 1, do_forward, "-f dll Forward calls to 'dll' (implies -t)"},
{"-D", SPEC, 0, do_document, "-D Generate documentation"},
- {"-o", SPEC, 1, do_name, "-o name Set the output dll name (default: dll)"},
+ {"-o", SPEC, 1, do_name, "-o name Set the output dll name (default: dll). note: strips .dll extensions"},
{"-C", SPEC, 0, do_cdecl, "-C Assume __cdecl calls (default: __stdcall)"},
{"-s", SPEC, 1, do_start, "-s num Start prototype search after symbol 'num'"},
{"-e", SPEC, 1, do_end, "-e num End prototype search after symbol 'num'"},
diff --git a/tools/winedump/search.c b/tools/winedump/search.c
index 79363b9..8667185 100644
--- a/tools/winedump/search.c
+++ b/tools/winedump/search.c
@@ -81,10 +81,20 @@
while (fgets (grep_buff, MAX_RESULT_LEN, grep))
{
int i;
- for (i = 0; grep_buff[i] && grep_buff[i] != '\n' ; i++)
- ;
+ const char *extension = grep_buff;
+ for (i = 0; grep_buff[i] && grep_buff[i] != '\n' ; i++) {
+ if (grep_buff[i] == '.')
+ extension = &grep_buff[i];
+ }
grep_buff[i] = '\0';
+ /* Definitly not in these: */
+ if (strcmp(extension,".dll") == 0 ||
+ strcmp(extension,".lib") == 0 ||
+ strcmp(extension,".so") == 0 ||
+ strcmp(extension,".o") == 0)
+ continue;
+
if (VERBOSE)
puts (grep_buff);
@@ -344,4 +354,3 @@
free (fgrep_buff);
}
#endif
-
diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h
index 3188a81..cda4ff2 100644
--- a/tools/winedump/winedump.h
+++ b/tools/winedump/winedump.h
@@ -126,7 +126,7 @@
int start_ordinal; /* -s */
int end_ordinal; /* -e */
search_symbol *search_symbol; /* -S */
- const char *directory; /* -I */
+ char *directory; /* -I */
const char *forward_dll; /* -f */
const char *dll_name; /* -o */
char *uc_dll_name; /* -o */