winedump dumb fixes
eric pouech
eric.pouech at wanadoo.fr
Fri Sep 21 14:35:51 CDT 2001
TSIA
A+
--
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle
-------------- next part --------------
Index: debug.c
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/tools/winedump/debug.c,v
retrieving revision 1.1
diff -u -r1.1 debug.c
--- debug.c 2001/09/07 16:04:39 1.1
+++ debug.c 2001/09/21 19:19:59
@@ -320,7 +320,7 @@
static void dump_codeview_all_modules(OMFDirHeader *omfdh)
{
- int i;
+ unsigned i;
OMFDirEntry *dirEntry;
const char* str;
@@ -376,7 +376,7 @@
OMFDirHeader *dirHeader;
OMFSignature *signature;
OMFDirEntry *dirEntry;
- int i;
+ unsigned i;
int modulecount = 0, alignsymcount = 0, srcmodulecount = 0, librariescount = 0;
int globalsymcount = 0, globalpubcount = 0, globaltypescount = 0;
int segmapcount = 0, fileindexcount = 0, staticsymcount = 0;
Index: main.c
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/tools/winedump/main.c,v
retrieving revision 1.2
diff -u -r1.2 main.c
--- main.c 2001/09/17 20:26:27 1.2
+++ main.c 2001/09/21 18:46:28
@@ -273,7 +273,7 @@
VERBOSE = 1;
symbol_init (&symbol, globals.input_name);
- if (symbol_demangle (&symbol) == -1);
+ if (symbol_demangle (&symbol) == -1)
fatal( "Symbol hasn't got a mangled name\n");
if (symbol.flags & SYM_DATA)
printf (symbol.arg_text[0]);
Index: msmangle.c
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/tools/winedump/msmangle.c,v
retrieving revision 1.2
diff -u -r1.2 msmangle.c
--- msmangle.c 2001/09/17 20:26:27 1.2
+++ msmangle.c 2001/09/18 19:45:21
@@ -487,15 +487,15 @@
/* FIXME: P6 = Function pointer, others who knows.. */
if (isdigit (*iter))
{
- if (*iter == 6) printf("Function pointer in argument list is not handled yet\n");
- return NULL;
+ if (*iter == '6') printf("Function pointer in argument list is not handled yet\n");
+ return NULL;
}
Index: pe.c
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/tools/winedump/pe.c,v
retrieving revision 1.3
diff -u -r1.3 pe.c
--- pe.c 2001/09/17 20:26:27 1.3
+++ pe.c 2001/09/21 19:27:37
@@ -18,7 +18,7 @@
#include "pe.h"
static void* base;
-static long total_len;
+static unsigned long total_len;
static IMAGE_NT_HEADERS* nt_headers;
enum FileSig {SIG_UNKNOWN, SIG_DOS, SIG_PE, SIG_DBG};
@@ -114,7 +114,7 @@
char *str;
IMAGE_FILE_HEADER *fileHeader;
IMAGE_OPTIONAL_HEADER *optionalHeader;
- int i;
+ unsigned i;
printf("File Header\n");
fileHeader = &nt_headers->FileHeader;
@@ -220,7 +220,7 @@
static void dump_sections(void* addr, unsigned num_sect)
{
IMAGE_SECTION_HEADER* sectHead = addr;
- int i;
+ unsigned i;
printf("Section Table\n");
for (i = 0; i < num_sect; i++, sectHead++)
@@ -655,14 +655,15 @@
int fd;
enum FileSig effective_sig;
int ret = 1;
-
+ struct stat s;
+
setbuf(stdout, NULL);
fd = open(name, O_RDONLY);
if (fd == -1) fatal("Can't open file");
- total_len = lseek(fd, 0, SEEK_END);
- if (total_len < 0) fatal("Can't get size");
+ if (fstat(fd, &s) < 0) fatal("Can't get size");
+ total_len = s.st_size;
base = mmap(NULL, total_len, PROT_READ, MAP_PRIVATE, fd, 0);
if (base == (void*)-1) fatal("Can't map file");
@@ -682,7 +683,7 @@
ret = 0; break;
case SIG_PE:
printf("Contents of \"%s\": %ld bytes\n\n", name, total_len);
- do_dump();
+ (*fn)();
break;
case SIG_DBG:
dump_separate_dbg();
More information about the wine-patches
mailing list