Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a58134ae
Commit
a58134ae
authored
Sep 16, 2002
by
Jan Kratochvil
Committed by
Alexandre Julliard
Sep 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New -S: Search only prototype names found in 'symfile'.
parent
2ca7000d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
2 deletions
+85
-2
main.c
tools/winedump/main.c
+76
-2
winedump.h
tools/winedump/winedump.h
+9
-0
No files found.
tools/winedump/main.c
View file @
a58134ae
...
...
@@ -124,6 +124,30 @@ static void do_end (const char *arg)
}
static
void
do_symfile
(
const
char
*
arg
)
{
FILE
*
f
;
char
symstring
[
256
];
/* keep count with "%<width>s" below */
search_symbol
*
symbolp
,
**
symbolptail
=
&
globals
.
search_symbol
;
if
(
!
(
f
=
fopen
(
arg
,
"rt"
)))
fatal
(
"Cannot open <symfile>"
);
while
(
1
==
fscanf
(
f
,
"%255s"
,
symstring
))
/* keep count with [<width>] above */
{
symstring
[
sizeof
(
symstring
)
-
1
]
=
'\0'
;
if
(
!
(
symbolp
=
malloc
(
sizeof
(
*
symbolp
)
+
strlen
(
symstring
))))
fatal
(
"Out of memory"
);
strcpy
(
symbolp
->
symbolname
,
symstring
);
symbolp
->
found
=
0
;
symbolp
->
next
=
NULL
;
*
symbolptail
=
symbolp
;
symbolptail
=
&
symbolp
->
next
;
}
if
(
fclose
(
f
))
fatal
(
"Cannot close <symfile>"
);
}
static
void
do_verbose
(
void
)
{
globals
.
do_verbose
=
1
;
...
...
@@ -173,6 +197,7 @@ static const struct option option_table[] = {
{
"-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'"
},
{
"-S"
,
SPEC
,
1
,
do_symfile
,
"-S symfile Search only prototype names found in 'symfile'"
},
{
"-q"
,
SPEC
,
0
,
do_quiet
,
"-q Don't show progress (quiet)."
},
{
"-v"
,
SPEC
,
0
,
do_verbose
,
"-v Show lots of detail while working (verbose)."
},
{
"dump"
,
DUMP
,
0
,
do_dump
,
"dump <mod> Dumps the content of the module (dll, exe...) named <mod>"
},
...
...
@@ -290,6 +315,54 @@ static void set_module_name(unsigned setUC)
OUTPUT_UC_DLL_NAME
=
(
setUC
)
?
str_toupper
(
strdup
(
OUTPUT_DLL_NAME
))
:
""
;
}
/* Marks the symbol as 'found'! */
/* return: perform-search */
static
int
symbol_searched
(
int
count
,
const
char
*
symbolname
)
{
search_symbol
*
search_symbol
;
if
(
!
(
count
>=
globals
.
start_ordinal
&&
(
!
globals
.
end_ordinal
||
count
<=
globals
.
end_ordinal
)))
return
0
;
if
(
!
globals
.
search_symbol
)
return
1
;
for
(
search_symbol
=
globals
.
search_symbol
;
search_symbol
;
search_symbol
=
search_symbol
->
next
)
{
if
(
!
strcmp
(
symbolname
,
search_symbol
->
symbolname
))
{
search_symbol
->
found
=
1
;
return
1
;
}
}
return
0
;
}
/* return: some symbols weren't found */
static
int
symbol_finish
(
void
)
{
const
search_symbol
*
search_symbol
;
int
started
=
0
;
for
(
search_symbol
=
globals
.
search_symbol
;
search_symbol
;
search_symbol
=
search_symbol
->
next
)
{
if
(
search_symbol
->
found
)
continue
;
if
(
!
started
)
{
/* stderr? not a practice here */
puts
(
"These requested <symfile> symbols weren't found:"
);
started
=
1
;
}
printf
(
"
\t
%s
\n
"
,
search_symbol
->
symbolname
);
return
1
;
}
return
started
;
}
/*******************************************************************
* main
*/
...
...
@@ -344,8 +417,7 @@ int main (int argc, char *argv[])
printf
(
"Export %3d - '%s' ...%c"
,
count
,
symbol
.
symbol
,
VERBOSE
?
'\n'
:
' '
);
if
(
globals
.
do_code
&&
count
>=
globals
.
start_ordinal
&&
(
!
globals
.
end_ordinal
||
count
<=
globals
.
end_ordinal
))
if
(
globals
.
do_code
&&
symbol_searched
(
count
,
symbol
.
symbol
))
{
/* Attempt to get information about the symbol */
int
result
=
symbol_demangle
(
&
symbol
);
...
...
@@ -375,6 +447,8 @@ int main (int argc, char *argv[])
if
(
VERBOSE
)
puts
(
"Finished, Cleaning up..."
);
if
(
symbol_finish
())
return
1
;
break
;
case
NONE
:
do_usage
();
...
...
tools/winedump/winedump.h
View file @
a58134ae
...
...
@@ -91,6 +91,14 @@ typedef struct __parsed_symbol
char
*
arg_name
[
MAX_FUNCTION_ARGS
];
}
parsed_symbol
;
/* FIXME: Replace with some hash such as GHashTable */
typedef
struct
__search_symbol
{
struct
__search_symbol
*
next
;
int
found
;
char
symbolname
[
1
];
/* static string, be ANSI C compliant by [1] */
}
search_symbol
;
/* All globals */
typedef
struct
__globals
{
...
...
@@ -117,6 +125,7 @@ typedef struct __globals
/* Option arguments: spec mode */
int
start_ordinal
;
/* -s */
int
end_ordinal
;
/* -e */
search_symbol
*
search_symbol
;
/* -S */
const
char
*
directory
;
/* -I */
const
char
*
forward_dll
;
/* -f */
const
char
*
dll_name
;
/* -o */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment