Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
99c27e7d
Commit
99c27e7d
authored
16 years ago
by
eric pouech
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dbghelp: Some cleanup in dwarf include files.
parent
3bc76576
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/dbghelp/dwarf.c
+32
-35
32 additions, 35 deletions
dlls/dbghelp/dwarf.c
dlls/dbghelp/dwarf.h
+0
-28
0 additions, 28 deletions
dlls/dbghelp/dwarf.h
with
32 additions
and
63 deletions
dlls/dbghelp/dwarf.c
+
32
−
35
View file @
99c27e7d
...
...
@@ -1982,29 +1982,40 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
}
static
BOOL
dwarf2_parse_compilation_unit
(
const
dwarf2_section_t
*
sections
,
const
dwarf2_comp_unit_t
*
comp_unit
,
struct
module
*
module
,
const
struct
elf_thunk_area
*
thunks
,
const
unsigned
char
*
comp_unit_cursor
,
dwarf2_traverse_context_t
*
mod_ctx
,
unsigned
long
load_offset
)
{
dwarf2_parse_context_t
ctx
;
dwarf2_traverse_context_t
traverse
;
dwarf2_traverse_context_t
abbrev_ctx
;
dwarf2_debug_info_t
*
di
;
dwarf2_traverse_context_t
cu_ctx
;
const
unsigned
char
*
comp_unit_start
=
mod_ctx
->
data
;
unsigned
long
cu_length
;
unsigned
short
cu_version
;
unsigned
long
cu_abbrev_offset
;
BOOL
ret
=
FALSE
;
cu_length
=
dwarf2_parse_u4
(
mod_ctx
);
cu_ctx
.
data
=
cu_ctx
.
start_data
=
mod_ctx
->
data
;
cu_ctx
.
end_data
=
mod_ctx
->
data
+
cu_length
;
mod_ctx
->
data
+=
cu_length
;
cu_version
=
dwarf2_parse_u2
(
&
cu_ctx
);
cu_abbrev_offset
=
dwarf2_parse_u4
(
&
cu_ctx
);
cu_ctx
.
word_size
=
dwarf2_parse_byte
(
&
cu_ctx
);
TRACE
(
"Compilation Unit Header found at 0x%x:
\n
"
,
comp_unit_
cursor
-
sections
[
section_debug
].
address
);
TRACE
(
"- length: %lu
\n
"
,
c
omp_unit
->
length
);
TRACE
(
"- version: %u
\n
"
,
c
omp_unit
->
version
);
TRACE
(
"- abbrev_offset: %lu
\n
"
,
c
omp_unit
->
abbrev_offset
);
TRACE
(
"- word_size: %u
\n
"
,
c
omp_unit
->
word_size
);
comp_unit_
start
-
sections
[
section_debug
].
address
);
TRACE
(
"- length: %lu
\n
"
,
c
u_
length
);
TRACE
(
"- version: %u
\n
"
,
c
u_
version
);
TRACE
(
"- abbrev_offset: %lu
\n
"
,
c
u_
abbrev_offset
);
TRACE
(
"- word_size: %u
\n
"
,
c
u_ctx
.
word_size
);
if
(
c
omp_unit
->
version
!=
2
)
if
(
c
u_
version
!=
2
)
{
WARN
(
"%u DWARF version unsupported. Wine dbghelp only support DWARF 2.
\n
"
,
c
omp_unit
->
version
);
c
u_
version
);
return
FALSE
;
}
...
...
@@ -2012,26 +2023,21 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
ctx
.
sections
=
sections
;
ctx
.
section
=
section_debug
;
ctx
.
module
=
module
;
ctx
.
word_size
=
c
omp_unit
->
word_size
;
ctx
.
word_size
=
c
u_ctx
.
word_size
;
ctx
.
thunks
=
thunks
;
ctx
.
load_offset
=
load_offset
;
ctx
.
ref_offset
=
comp_unit_
cursor
-
sections
[
section_debug
].
address
;
ctx
.
ref_offset
=
comp_unit_
start
-
sections
[
section_debug
].
address
;
memset
(
ctx
.
symt_cache
,
0
,
sizeof
(
ctx
.
symt_cache
));
ctx
.
symt_cache
[
sc_void
]
=
&
symt_new_basic
(
module
,
btVoid
,
"void"
,
0
)
->
symt
;
traverse
.
start_data
=
comp_unit_cursor
+
sizeof
(
dwarf2_comp_unit_stream_t
);
traverse
.
data
=
traverse
.
start_data
;
traverse
.
word_size
=
comp_unit
->
word_size
;
traverse
.
end_data
=
comp_unit_cursor
+
comp_unit
->
length
+
sizeof
(
unsigned
);
abbrev_ctx
.
start_data
=
sections
[
section_abbrev
].
address
+
comp_unit
->
abbrev_offset
;
abbrev_ctx
.
start_data
=
sections
[
section_abbrev
].
address
+
cu_abbrev_offset
;
abbrev_ctx
.
data
=
abbrev_ctx
.
start_data
;
abbrev_ctx
.
end_data
=
sections
[
section_abbrev
].
address
+
sections
[
section_abbrev
].
size
;
abbrev_ctx
.
word_size
=
c
omp_unit
->
word_size
;
abbrev_ctx
.
word_size
=
c
u_ctx
.
word_size
;
dwarf2_parse_abbrev_set
(
&
abbrev_ctx
,
&
ctx
.
abbrev_table
,
&
ctx
.
pool
);
sparse_array_init
(
&
ctx
.
debug_info_table
,
sizeof
(
dwarf2_debug_info_t
),
128
);
dwarf2_read_one_debug_info
(
&
ctx
,
&
traverse
,
&
di
);
dwarf2_read_one_debug_info
(
&
ctx
,
&
cu_ctx
,
&
di
);
if
(
di
->
abbrev
->
tag
==
DW_TAG_compile_unit
)
{
...
...
@@ -2223,8 +2229,10 @@ BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
{
dwarf2_section_t
section
[
section_max
];
unsigned
char
*
ptr
;
const
unsigned
char
*
comp_unit_cursor
=
debug
;
const
unsigned
char
*
end_debug
=
debug
+
debug_size
;
dwarf2_traverse_context_t
mod_ctx
;
mod_ctx
.
start_data
=
mod_ctx
.
data
=
debug
;
mod_ctx
.
end_data
=
debug
+
debug_size
;
module
->
loc_compute
=
dwarf2_location_compute
;
...
...
@@ -2251,20 +2259,9 @@ BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
module
->
dwarf2_info
->
debug_loc
.
size
=
loclist_size
;
}
while
(
comp_unit_cursor
<
end_d
ebug
)
while
(
mod_ctx
.
data
<
mod_ctx
.
end_d
ata
)
{
const
dwarf2_comp_unit_stream_t
*
comp_unit_stream
;
dwarf2_comp_unit_t
comp_unit
;
comp_unit_stream
=
(
const
dwarf2_comp_unit_stream_t
*
)
comp_unit_cursor
;
comp_unit
.
length
=
*
(
const
unsigned
long
*
)
comp_unit_stream
->
length
;
comp_unit
.
version
=
*
(
const
unsigned
short
*
)
comp_unit_stream
->
version
;
comp_unit
.
abbrev_offset
=
*
(
const
unsigned
long
*
)
comp_unit_stream
->
abbrev_offset
;
comp_unit
.
word_size
=
*
(
const
unsigned
char
*
)
comp_unit_stream
->
word_size
;
dwarf2_parse_compilation_unit
(
section
,
&
comp_unit
,
module
,
thunks
,
comp_unit_cursor
,
load_offset
);
comp_unit_cursor
+=
comp_unit
.
length
+
sizeof
(
unsigned
);
dwarf2_parse_compilation_unit
(
section
,
module
,
thunks
,
&
mod_ctx
,
load_offset
);
}
module
->
module
.
SymType
=
SymDia
;
module
->
module
.
CVSig
=
'D'
|
(
'W'
<<
8
)
|
(
'A'
<<
16
)
|
(
'R'
<<
24
);
...
...
This diff is collapsed.
Click to expand it.
dlls/dbghelp/dwarf.h
+
0
−
28
View file @
99c27e7d
...
...
@@ -18,34 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
typedef
struct
{
unsigned
char
length
[
4
];
unsigned
char
version
[
2
];
unsigned
char
abbrev_offset
[
4
];
unsigned
char
word_size
[
1
];
}
dwarf2_comp_unit_stream_t
;
typedef
struct
{
unsigned
long
length
;
unsigned
short
version
;
unsigned
long
abbrev_offset
;
unsigned
char
word_size
;
}
dwarf2_comp_unit_t
;
typedef
struct
{
unsigned
int
length
;
unsigned
short
version
;
unsigned
int
prologue_length
;
unsigned
char
min_insn_length
;
unsigned
char
default_is_stmt
;
int
line_base
;
unsigned
char
line_range
;
unsigned
char
opcode_base
;
}
dwarf2_line_info_t
;
typedef
enum
dwarf_tag_e
{
DW_TAG_padding
=
0x00
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment