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
947f2456
Commit
947f2456
authored
Dec 09, 2009
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedump: Rewrote a bit the COFF symbol table stuff.
parent
8b3ff9d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
52 deletions
+54
-52
debug.c
tools/winedump/debug.c
+54
-52
No files found.
tools/winedump/debug.c
View file @
947f2456
...
...
@@ -512,70 +512,72 @@ static const char *get_coff_name( const IMAGE_SYMBOL *coff_sym, const char *coff
return
nampnt
;
}
void
dump_coff
(
unsigned
long
coffbase
,
unsigned
long
len
,
const
void
*
pmt
)
static
const
char
*
storage_class
(
BYTE
sc
)
{
static
char
tmp
[
7
];
switch
(
sc
)
{
case
IMAGE_SYM_CLASS_STATIC
:
return
"static"
;
case
IMAGE_SYM_CLASS_EXTERNAL
:
return
"extrnl"
;
case
IMAGE_SYM_CLASS_LABEL
:
return
"label "
;
}
sprintf
(
tmp
,
"#%d"
,
sc
);
return
tmp
;
}
void
dump_coff_symbol_table
(
const
IMAGE_SYMBOL
*
coff_symbols
,
unsigned
num_sym
,
const
IMAGE_SECTION_HEADER
*
sectHead
)
{
const
IMAGE_COFF_SYMBOLS_HEADER
*
coff
=
PRD
(
coffbase
,
len
);
const
IMAGE_SYMBOL
*
coff_sym
;
const
IMAGE_SYMBOL
*
coff_symbols
=
(
const
IMAGE_SYMBOL
*
)
((
const
char
*
)
coff
+
coff
->
LvaToFirstSymbol
);
const
char
*
coff_strtab
=
(
const
char
*
)
(
coff_symbols
+
coff
->
NumberOfSymbols
);
const
IMAGE_SECTION_HEADER
*
sectHead
=
pmt
;
const
char
*
coff_strtab
=
(
const
char
*
)
(
coff_symbols
+
num_sym
);
unsigned
int
i
;
const
char
*
nampnt
;
int
naux
;
printf
(
"
\n
Debug table: COFF format.
modbase %p, coffbase %p
\n
"
,
PRD
(
0
,
0
),
coff
);
printf
(
" ID | seg:offs [ abs ] | symbol/function name
\n
"
);
for
(
i
=
0
;
i
<
coff
->
NumberOfSymbols
;
i
++
)
printf
(
"
\n
Debug table: COFF format.
\n
"
);
printf
(
" ID | seg:offs [ abs ] |
Kind |
symbol/function name
\n
"
);
for
(
i
=
0
;
i
<
num_sym
;
i
++
)
{
coff_sym
=
coff_symbols
+
i
;
naux
=
coff_sym
->
NumberOfAuxSymbols
;
if
(
coff_sym
->
StorageClass
==
IMAGE_SYM_CLASS_FILE
)
{
printf
(
"file %s
\n
"
,
(
const
char
*
)
(
coff_sym
+
1
));
i
+=
naux
;
continue
;
}
if
(
(
coff_sym
->
StorageClass
==
IMAGE_SYM_CLASS_STATIC
)
&&
(
naux
==
0
)
&&
(
coff_sym
->
SectionNumber
==
1
)
)
{
DWORD
base
=
sectHead
[
coff_sym
->
SectionNumber
-
1
].
VirtualAddress
;
/*
* This is a normal static function when naux == 0.
* Just register it. The current file is the correct
* one in this instance.
*/
nampnt
=
get_coff_name
(
coff_sym
,
coff_strtab
);
printf
(
"%05d | %02d:%08x [%08x] | %s
\n
"
,
i
,
coff_sym
->
SectionNumber
-
1
,
coff_sym
->
Value
-
base
,
coff_sym
->
Value
,
nampnt
);
i
+=
naux
;
continue
;
}
coff_sym
=
coff_symbols
+
i
;
naux
=
coff_sym
->
NumberOfAuxSymbols
;
if
(
(
coff_sym
->
StorageClass
==
IMAGE_SYM_CLASS_EXTERNAL
)
&&
ISFCN
(
coff_sym
->
Type
)
&&
(
coff_sym
->
SectionNumber
>
0
)
)
switch
(
coff_sym
->
StorageClass
)
{
DWORD
base
=
sectHead
[
coff_sym
->
SectionNumber
-
1
].
VirtualAddress
;
nampnt
=
get_coff_name
(
coff_sym
,
coff_strtab
);
case
IMAGE_SYM_CLASS_FILE
:
printf
(
"file %s
\n
"
,
(
const
char
*
)
(
coff_sym
+
1
));
break
;
case
IMAGE_SYM_CLASS_STATIC
:
case
IMAGE_SYM_CLASS_EXTERNAL
:
case
IMAGE_SYM_CLASS_LABEL
:
if
(
coff_sym
->
SectionNumber
>
0
)
{
DWORD
base
=
sectHead
[
coff_sym
->
SectionNumber
-
1
].
VirtualAddress
;
nampnt
=
get_coff_name
(
coff_sym
,
coff_strtab
);
/* FIXME: add code to find out the file this symbol belongs to,
* see winedbg */
printf
(
"%05d | %02d:%08x [%08x] | %s
\n
"
,
i
,
coff_sym
->
SectionNumber
-
1
,
coff_sym
->
Value
-
base
,
coff_sym
->
Value
,
nampnt
);
i
+=
naux
;
continue
;
}
printf
(
"%05d | %02d:%08x [%08x] | %s | %s
\n
"
,
i
,
coff_sym
->
SectionNumber
-
1
,
coff_sym
->
Value
,
base
+
coff_sym
->
Value
,
storage_class
(
coff_sym
->
StorageClass
),
nampnt
);
}
break
;
default:
printf
(
"%05d | %s
\n
"
,
i
,
storage_class
(
coff_sym
->
StorageClass
));
}
/*
* For now, skip past the aux entries.
*/
i
+=
naux
;
}
}
/*
* For now, skip past the aux entries.
*/
i
+=
naux
;
void
dump_coff
(
unsigned
long
coffbase
,
unsigned
long
len
,
const
void
*
pmt
)
{
const
IMAGE_COFF_SYMBOLS_HEADER
*
coff
=
PRD
(
coffbase
,
len
);
const
IMAGE_SYMBOL
*
coff_symbols
=
(
const
IMAGE_SYMBOL
*
)
((
const
char
*
)
coff
+
coff
->
LvaToFirstSymbol
);
const
IMAGE_SECTION_HEADER
*
sectHead
=
pmt
;
}
dump_coff_symbol_table
(
coff_symbols
,
coff
->
NumberOfSymbols
,
sectHead
);
}
void
dump_codeview
(
unsigned
long
base
,
unsigned
long
len
)
...
...
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