Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7af4097d
Commit
7af4097d
authored
Jun 18, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Jun 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Added the ability to define a source file by dir+filename instead of only filename.
parent
52db5c09
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
40 deletions
+40
-40
coff.c
dlls/dbghelp/coff.c
+1
-1
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+2
-3
dwarf.c
dlls/dbghelp/dwarf.c
+5
-6
elf_module.c
dlls/dbghelp/elf_module.c
+1
-1
msc.c
dlls/dbghelp/msc.c
+5
-3
source.c
dlls/dbghelp/source.c
+19
-4
stabs.c
dlls/dbghelp/stabs.c
+4
-19
symbol.c
dlls/dbghelp/symbol.c
+3
-3
No files found.
dlls/dbghelp/coff.c
View file @
7af4097d
...
@@ -120,7 +120,7 @@ static int coff_add_file(struct CoffFileSet* coff_files, struct module* module,
...
@@ -120,7 +120,7 @@ static int coff_add_file(struct CoffFileSet* coff_files, struct module* module,
file
=
coff_files
->
files
+
coff_files
->
nfiles
;
file
=
coff_files
->
files
+
coff_files
->
nfiles
;
file
->
startaddr
=
0xffffffff
;
file
->
startaddr
=
0xffffffff
;
file
->
endaddr
=
0
;
file
->
endaddr
=
0
;
file
->
compiland
=
symt_new_compiland
(
module
,
filename
);
file
->
compiland
=
symt_new_compiland
(
module
,
source_new
(
module
,
NULL
,
filename
)
);
file
->
linetab_offset
=
-
1
;
file
->
linetab_offset
=
-
1
;
file
->
linecnt
=
0
;
file
->
linecnt
=
0
;
file
->
entries
=
NULL
;
file
->
entries
=
NULL
;
...
...
dlls/dbghelp/dbghelp_private.h
View file @
7af4097d
...
@@ -422,7 +422,7 @@ extern struct module*
...
@@ -422,7 +422,7 @@ extern struct module*
extern
BOOL
pe_load_debug_info
(
const
struct
process
*
pcs
,
extern
BOOL
pe_load_debug_info
(
const
struct
process
*
pcs
,
struct
module
*
module
);
struct
module
*
module
);
/* source.c */
/* source.c */
extern
unsigned
source_new
(
struct
module
*
module
,
const
char
*
source
);
extern
unsigned
source_new
(
struct
module
*
module
,
const
char
*
basedir
,
const
char
*
source
);
extern
const
char
*
source_get
(
const
struct
module
*
module
,
unsigned
idx
);
extern
const
char
*
source_get
(
const
struct
module
*
module
,
unsigned
idx
);
/* stabs.c */
/* stabs.c */
...
@@ -442,8 +442,7 @@ extern const char* symt_get_name(const struct symt* sym);
...
@@ -442,8 +442,7 @@ extern const char* symt_get_name(const struct symt* sym);
extern
int
symt_cmp_addr
(
const
void
*
p1
,
const
void
*
p2
);
extern
int
symt_cmp_addr
(
const
void
*
p1
,
const
void
*
p2
);
extern
int
symt_find_nearest
(
struct
module
*
module
,
DWORD
addr
);
extern
int
symt_find_nearest
(
struct
module
*
module
,
DWORD
addr
);
extern
struct
symt_compiland
*
extern
struct
symt_compiland
*
symt_new_compiland
(
struct
module
*
module
,
symt_new_compiland
(
struct
module
*
module
,
unsigned
src_idx
);
const
char
*
filename
);
extern
struct
symt_public
*
extern
struct
symt_public
*
symt_new_public
(
struct
module
*
module
,
symt_new_public
(
struct
module
*
module
,
struct
symt_compiland
*
parent
,
struct
symt_compiland
*
parent
,
...
...
dlls/dbghelp/dwarf.c
View file @
7af4097d
...
@@ -1436,7 +1436,7 @@ static void dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
...
@@ -1436,7 +1436,7 @@ static void dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
while
(
traverse
.
data
<
traverse
.
end_data
)
while
(
traverse
.
data
<
traverse
.
end_data
)
{
{
unsigned
long
address
;
unsigned
long
address
=
0
;
unsigned
file
=
1
;
unsigned
file
=
1
;
unsigned
line
=
1
;
unsigned
line
=
1
;
unsigned
is_stmt
=
default_stmt
;
unsigned
is_stmt
=
default_stmt
;
...
@@ -1467,10 +1467,10 @@ static void dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
...
@@ -1467,10 +1467,10 @@ static void dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
address
+=
insn_size
*
dwarf2_leb128_as_unsigned
(
&
traverse
);
address
+=
insn_size
*
dwarf2_leb128_as_unsigned
(
&
traverse
);
break
;
break
;
case
DW_LNS_advance_line
:
case
DW_LNS_advance_line
:
line
+=
dwarf2_leb128_as_
un
signed
(
&
traverse
);
line
+=
dwarf2_leb128_as_signed
(
&
traverse
);
break
;
break
;
case
DW_LNS_set_file
:
case
DW_LNS_set_file
:
file
=
dwarf2_leb128_as_signed
(
&
traverse
);
file
=
dwarf2_leb128_as_
un
signed
(
&
traverse
);
break
;
break
;
case
DW_LNS_set_column
:
case
DW_LNS_set_column
:
dwarf2_leb128_as_unsigned
(
&
traverse
);
dwarf2_leb128_as_unsigned
(
&
traverse
);
...
@@ -1496,8 +1496,7 @@ static void dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
...
@@ -1496,8 +1496,7 @@ static void dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
end_sequence
=
TRUE
;
end_sequence
=
TRUE
;
break
;
break
;
case
DW_LNE_set_address
:
case
DW_LNE_set_address
:
address
=
dwarf2_parse_addr
(
&
traverse
);
address
=
ctx
->
module
->
module
.
BaseOfImage
+
dwarf2_parse_addr
(
&
traverse
);
address
+=
ctx
->
module
->
module
.
BaseOfImage
;
break
;
break
;
case
DW_LNE_define_file
:
case
DW_LNE_define_file
:
traverse
.
data
+=
strlen
((
const
char
*
)
traverse
.
data
)
+
1
;
traverse
.
data
+=
strlen
((
const
char
*
)
traverse
.
data
)
+
1
;
...
@@ -1579,7 +1578,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
...
@@ -1579,7 +1578,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
TRACE
(
"beginning at 0x%lx, for %lu
\n
"
,
di
->
offset
,
di
->
abbrev
->
entry_code
);
TRACE
(
"beginning at 0x%lx, for %lu
\n
"
,
di
->
offset
,
di
->
abbrev
->
entry_code
);
dwarf2_find_name
(
&
ctx
,
di
,
&
name
,
"compiland"
);
dwarf2_find_name
(
&
ctx
,
di
,
&
name
,
"compiland"
);
di
->
symt
=
&
symt_new_compiland
(
module
,
name
.
string
)
->
symt
;
di
->
symt
=
&
symt_new_compiland
(
module
,
source_new
(
module
,
NULL
,
name
.
string
)
)
->
symt
;
if
(
di
->
abbrev
->
have_child
)
if
(
di
->
abbrev
->
have_child
)
{
{
...
...
dlls/dbghelp/elf_module.c
View file @
7af4097d
...
@@ -292,7 +292,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool,
...
@@ -292,7 +292,7 @@ static void elf_hash_symtab(struct module* module, struct pool* pool,
if
(
ELF32_ST_TYPE
(
symp
->
st_info
)
==
STT_FILE
)
if
(
ELF32_ST_TYPE
(
symp
->
st_info
)
==
STT_FILE
)
{
{
compiland
=
symname
?
symt_new_compiland
(
module
,
s
ymname
)
:
NULL
;
compiland
=
symname
?
symt_new_compiland
(
module
,
s
ource_new
(
module
,
NULL
,
symname
)
)
:
NULL
;
continue
;
continue
;
}
}
for
(
j
=
0
;
thunks
[
j
].
symname
;
j
++
)
for
(
j
=
0
;
thunks
[
j
].
symname
;
j
++
)
...
...
dlls/dbghelp/msc.c
View file @
7af4097d
...
@@ -1136,10 +1136,10 @@ static struct codeview_linetab* codeview_snarf_linetab(struct module* module,
...
@@ -1136,10 +1136,10 @@ static struct codeview_linetab* codeview_snarf_linetab(struct module* module,
p_fn
=
(
const
struct
p_string
*
)(
start
+
file_segcount
);
p_fn
=
(
const
struct
p_string
*
)(
start
+
file_segcount
);
memset
(
filename
,
0
,
sizeof
(
filename
));
memset
(
filename
,
0
,
sizeof
(
filename
));
memcpy
(
filename
,
p_fn
->
name
,
p_fn
->
namelen
);
memcpy
(
filename
,
p_fn
->
name
,
p_fn
->
namelen
);
source
=
source_new
(
module
,
filename
);
source
=
source_new
(
module
,
NULL
,
filename
);
}
}
else
else
source
=
source_new
(
module
,
(
const
char
*
)(
start
+
file_segcount
));
source
=
source_new
(
module
,
NULL
,
(
const
char
*
)(
start
+
file_segcount
));
for
(
k
=
0
;
k
<
file_segcount
;
k
++
,
this_seg
++
)
for
(
k
=
0
;
k
<
file_segcount
;
k
++
,
this_seg
++
)
{
{
...
@@ -1465,7 +1465,9 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
...
@@ -1465,7 +1465,9 @@ static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root
case
S_OBJNAME_V1
:
case
S_OBJNAME_V1
:
TRACE
(
"S-ObjName %s
\n
"
,
terminate_string
(
&
sym
->
objname_v1
.
p_name
));
TRACE
(
"S-ObjName %s
\n
"
,
terminate_string
(
&
sym
->
objname_v1
.
p_name
));
compiland
=
symt_new_compiland
(
msc_dbg
->
module
,
terminate_string
(
&
sym
->
objname_v1
.
p_name
));
compiland
=
symt_new_compiland
(
msc_dbg
->
module
,
source_new
(
msc_dbg
->
module
,
NULL
,
terminate_string
(
&
sym
->
objname_v1
.
p_name
)));
break
;
break
;
case
S_LABEL_V1
:
case
S_LABEL_V1
:
...
...
dlls/dbghelp/source.c
View file @
7af4097d
...
@@ -54,16 +54,30 @@ static unsigned source_find(const struct module* module, const char* name)
...
@@ -54,16 +54,30 @@ static unsigned source_find(const struct module* module, const char* name)
*
*
* checks if source exists. if not, add it
* checks if source exists. if not, add it
*/
*/
unsigned
source_new
(
struct
module
*
module
,
const
char
*
name
)
unsigned
source_new
(
struct
module
*
module
,
const
char
*
base
,
const
char
*
name
)
{
{
int
len
;
int
len
;
unsigned
ret
;
unsigned
ret
;
const
char
*
full
;
if
(
!
name
)
return
(
unsigned
)
-
1
;
if
(
!
name
)
return
(
unsigned
)
-
1
;
if
(
module
->
sources
&&
(
ret
=
source_find
(
module
,
name
))
!=
(
unsigned
)
-
1
)
if
(
!
base
||
*
name
==
'/'
)
full
=
name
;
else
{
unsigned
bsz
=
strlen
(
base
);
char
*
tmp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bsz
+
1
+
strlen
(
name
)
+
1
);
if
(
!
tmp
)
return
(
unsigned
)
-
1
;
full
=
tmp
;
strcpy
(
tmp
,
base
);
if
(
tmp
[
bsz
-
1
]
!=
'/'
)
tmp
[
bsz
++
]
=
'/'
;
strcpy
(
&
tmp
[
bsz
],
name
);
}
if
(
module
->
sources
&&
(
ret
=
source_find
(
module
,
full
))
!=
(
unsigned
)
-
1
)
return
ret
;
return
ret
;
len
=
strlen
(
name
)
+
1
;
len
=
strlen
(
full
)
+
1
;
if
(
module
->
sources_used
+
len
+
1
>
module
->
sources_alloc
)
if
(
module
->
sources_used
+
len
+
1
>
module
->
sources_alloc
)
{
{
/* Alloc by block of 256 bytes */
/* Alloc by block of 256 bytes */
...
@@ -75,9 +89,10 @@ unsigned source_new(struct module* module, const char* name)
...
@@ -75,9 +89,10 @@ unsigned source_new(struct module* module, const char* name)
module
->
sources_alloc
);
module
->
sources_alloc
);
}
}
ret
=
module
->
sources_used
;
ret
=
module
->
sources_used
;
strcpy
(
module
->
sources
+
module
->
sources_used
,
name
);
strcpy
(
module
->
sources
+
module
->
sources_used
,
full
);
module
->
sources_used
+=
len
;
module
->
sources_used
+=
len
;
module
->
sources
[
module
->
sources_used
]
=
'\0'
;
module
->
sources
[
module
->
sources_used
]
=
'\0'
;
if
(
full
!=
name
)
HeapFree
(
GetProcessHeap
(),
0
,
(
char
*
)
full
);
return
ret
;
return
ret
;
}
}
...
...
dlls/dbghelp/stabs.c
View file @
7af4097d
...
@@ -1173,7 +1173,6 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
...
@@ -1173,7 +1173,6 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
struct
symt_function
*
curr_func
=
NULL
;
struct
symt_function
*
curr_func
=
NULL
;
struct
symt_block
*
block
=
NULL
;
struct
symt_block
*
block
=
NULL
;
struct
symt_compiland
*
compiland
=
NULL
;
struct
symt_compiland
*
compiland
=
NULL
;
char
currpath
[
PATH_MAX
];
/* path to current file */
char
srcpath
[
PATH_MAX
];
/* path to directory source file is in */
char
srcpath
[
PATH_MAX
];
/* path to directory source file is in */
int
i
;
int
i
;
int
nstab
;
int
nstab
;
...
@@ -1475,30 +1474,16 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
...
@@ -1475,30 +1474,16 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
int
len
=
strlen
(
ptr
);
int
len
=
strlen
(
ptr
);
if
(
ptr
[
len
-
1
]
!=
'/'
)
if
(
ptr
[
len
-
1
]
!=
'/'
)
{
{
if
(
ptr
[
0
]
==
'/'
)
strcpy
(
currpath
,
ptr
);
else
{
strcpy
(
currpath
,
srcpath
);
strcat
(
currpath
,
ptr
);
}
stabs_reset_includes
();
stabs_reset_includes
();
compiland
=
symt_new_compiland
(
module
,
currpath
);
source_idx
=
source_new
(
module
,
srcpath
,
ptr
);
source_idx
=
source_new
(
module
,
currpath
);
compiland
=
symt_new_compiland
(
module
,
source_idx
);
}
}
else
else
strcpy
(
srcpath
,
ptr
);
strcpy
(
srcpath
,
ptr
);
}
}
break
;
break
;
case
N_SOL
:
case
N_SOL
:
if
(
*
ptr
!=
'/'
)
source_idx
=
source_new
(
module
,
srcpath
,
ptr
);
{
strcpy
(
currpath
,
srcpath
);
strcat
(
currpath
,
ptr
);
}
else
strcpy
(
currpath
,
ptr
);
source_idx
=
source_new
(
module
,
currpath
);
break
;
break
;
case
N_UNDF
:
case
N_UNDF
:
strs
+=
strtabinc
;
strs
+=
strtabinc
;
...
@@ -1518,7 +1503,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
...
@@ -1518,7 +1503,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
stabs_add_include
(
stabs_new_include
(
ptr
,
stab_ptr
->
n_value
));
stabs_add_include
(
stabs_new_include
(
ptr
,
stab_ptr
->
n_value
));
assert
(
incl_stk
<
(
int
)(
sizeof
(
incl
)
/
sizeof
(
incl
[
0
]))
-
1
);
assert
(
incl_stk
<
(
int
)(
sizeof
(
incl
)
/
sizeof
(
incl
[
0
]))
-
1
);
incl
[
++
incl_stk
]
=
source_idx
;
incl
[
++
incl_stk
]
=
source_idx
;
source_idx
=
source_new
(
module
,
ptr
);
source_idx
=
source_new
(
module
,
NULL
,
ptr
);
break
;
break
;
case
N_EINCL
:
case
N_EINCL
:
assert
(
incl_stk
>=
0
);
assert
(
incl_stk
>=
0
);
...
...
dlls/dbghelp/symbol.c
View file @
7af4097d
...
@@ -125,16 +125,16 @@ static void compile_regex(const char* str, int numchar, regex_t* re, BOOL _case)
...
@@ -125,16 +125,16 @@ static void compile_regex(const char* str, int numchar, regex_t* re, BOOL _case)
HeapFree
(
GetProcessHeap
(),
0
,
mask
);
HeapFree
(
GetProcessHeap
(),
0
,
mask
);
}
}
struct
symt_compiland
*
symt_new_compiland
(
struct
module
*
module
,
const
char
*
name
)
struct
symt_compiland
*
symt_new_compiland
(
struct
module
*
module
,
unsigned
src_idx
)
{
{
struct
symt_compiland
*
sym
;
struct
symt_compiland
*
sym
;
TRACE_
(
dbghelp_symt
)(
"Adding compiland symbol %s:%s
\n
"
,
TRACE_
(
dbghelp_symt
)(
"Adding compiland symbol %s:%s
\n
"
,
module
->
module
.
ModuleName
,
name
);
module
->
module
.
ModuleName
,
source_get
(
module
,
src_idx
)
);
if
((
sym
=
pool_alloc
(
&
module
->
pool
,
sizeof
(
*
sym
))))
if
((
sym
=
pool_alloc
(
&
module
->
pool
,
sizeof
(
*
sym
))))
{
{
sym
->
symt
.
tag
=
SymTagCompiland
;
sym
->
symt
.
tag
=
SymTagCompiland
;
sym
->
source
=
s
ource_new
(
module
,
name
)
;
sym
->
source
=
s
rc_idx
;
vector_init
(
&
sym
->
vchildren
,
sizeof
(
struct
symt
*
),
32
);
vector_init
(
&
sym
->
vchildren
,
sizeof
(
struct
symt
*
),
32
);
}
}
return
sym
;
return
sym
;
...
...
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