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
ae6239d5
Commit
ae6239d5
authored
Nov 18, 2005
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 18, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Centralized calls for SymSetContext, we only do it when we change the
current stack frame, and no longer every time we look up local symbols on current stack
parent
e968628e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
24 deletions
+14
-24
stack.c
programs/winedbg/stack.c
+9
-7
symbol.c
programs/winedbg/symbol.c
+5
-16
winedbg.c
programs/winedbg/winedbg.c
+0
-1
No files found.
programs/winedbg/stack.c
View file @
ae6239d5
...
...
@@ -141,8 +141,6 @@ unsigned stack_fetch_frames(void)
HeapFree
(
GetProcessHeap
(),
0
,
dbg_curr_thread
->
frames
);
dbg_curr_thread
->
frames
=
NULL
;
dbg_curr_thread
->
num_frames
=
0
;
dbg_curr_thread
->
curr_frame
=
0
;
memset
(
&
sf
,
0
,
sizeof
(
sf
));
memory_get_current_frame
(
&
sf
.
AddrFrame
);
...
...
@@ -168,7 +166,10 @@ unsigned stack_fetch_frames(void)
/* we've probably gotten ourselves into an infinite loop so bail */
if
(
nf
>
200
)
break
;
}
return
dbg_curr_thread
->
num_frames
=
nf
;
dbg_curr_thread
->
curr_frame
=
-
1
;
dbg_curr_thread
->
num_frames
=
nf
;
stack_set_frame_internal
(
0
);
return
nf
;
}
struct
sym_enum
...
...
@@ -215,9 +216,6 @@ static void stack_print_addr_and_args(int nf)
stack_get_frame_internal
(
nf
,
&
ihsf
);
ihsf
.
InstructionOffset
=
(
DWORD_PTR
)
memory_to_linear_addr
(
&
dbg_curr_thread
->
frames
[
nf
].
addr_pc
);
ihsf
.
FrameOffset
=
(
DWORD_PTR
)
memory_to_linear_addr
(
&
dbg_curr_thread
->
frames
[
nf
].
addr_frame
);
/* grab module where symbol is. If we don't have a module, we cannot print more */
im
.
SizeOfStruct
=
sizeof
(
im
);
if
(
!
SymGetModuleInfo
(
dbg_curr_process
->
handle
,
ihsf
.
InstructionOffset
,
&
im
))
...
...
@@ -258,7 +256,8 @@ static void stack_print_addr_and_args(int nf)
*/
static
unsigned
backtrace
(
void
)
{
unsigned
nf
=
0
;
unsigned
nf
=
0
;
IMAGEHLP_STACK_FRAME
ihsf
;
dbg_printf
(
"Backtrace:
\n
"
);
for
(
nf
=
0
;
nf
<
dbg_curr_thread
->
num_frames
;
nf
++
)
...
...
@@ -270,6 +269,9 @@ static unsigned backtrace(void)
print_bare_address
(
&
dbg_curr_thread
->
frames
[
nf
].
addr_pc
);
dbg_printf
(
")
\n
"
);
}
/* reset context to current stack frame */
stack_get_frame_internal
(
dbg_curr_thread
->
curr_frame
,
&
ihsf
);
SymSetContext
(
dbg_curr_process
->
handle
,
&
ihsf
,
NULL
);
return
nf
;
}
...
...
programs/winedbg/symbol.c
View file @
ae6239d5
...
...
@@ -209,8 +209,6 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
{
struct
sgv_data
sgv
;
int
i
=
0
;
char
tmp
[
sizeof
(
SYMBOL_INFO
)
+
256
];
SYMBOL_INFO
*
si
=
(
SYMBOL_INFO
*
)
tmp
;
char
buffer
[
512
];
DWORD
opt
;
IMAGEHLP_STACK_FRAME
ihsf
;
...
...
@@ -275,13 +273,10 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
SymSetOptions
(
opt
);
/* now grab local symbols */
si
->
SizeOfStruct
=
sizeof
(
*
si
);
si
->
MaxNameLen
=
256
;
if
(
stack_get_frame
(
si
,
&
ihsf
)
&&
sgv
.
num
<
NUMDBGV
)
if
(
stack_get_current_frame
(
&
ihsf
)
&&
sgv
.
num
<
NUMDBGV
)
{
sgv
.
frame_offset
=
ihsf
.
FrameOffset
;
if
(
SymSetContext
(
dbg_curr_process
->
handle
,
&
ihsf
,
NULL
))
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
name
,
sgv_cb
,
(
void
*
)
&
sgv
);
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
name
,
sgv_cb
,
(
void
*
)
&
sgv
);
}
if
(
!
sgv
.
num
)
...
...
@@ -308,7 +303,7 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
dbg_printf
(
"%s %sof %s
\n
"
,
sgv
.
syms
[
i
].
flags
&
SYMFLAG_PARAMETER
?
"Parameter"
:
"Local variable"
,
sgv
.
syms
[
i
].
flags
&
(
SYMFLAG_REGISTER
|
SYMFLAG_REGREL
)
?
"(in a register) "
:
""
,
si
->
N
ame
);
n
ame
);
}
else
if
(
sgv
.
syms
[
i
].
flags
&
SYMFLAG_THUNK
)
{
...
...
@@ -353,8 +348,6 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
BOOL
symbol_is_local
(
const
char
*
name
)
{
struct
sgv_data
sgv
;
char
tmp
[
sizeof
(
SYMBOL_INFO
)
+
256
];
SYMBOL_INFO
*
si
=
(
SYMBOL_INFO
*
)
tmp
;
IMAGEHLP_STACK_FRAME
ihsf
;
sgv
.
num
=
0
;
...
...
@@ -365,10 +358,7 @@ BOOL symbol_is_local(const char* name)
sgv
.
bp_disp
=
FALSE
;
sgv
.
do_thunks
=
FALSE
;
si
->
SizeOfStruct
=
sizeof
(
*
si
);
si
->
MaxNameLen
=
256
;
if
(
stack_get_frame
(
si
,
&
ihsf
)
&&
SymSetContext
(
dbg_curr_process
->
handle
,
&
ihsf
,
NULL
))
if
(
stack_get_current_frame
(
&
ihsf
))
{
sgv
.
frame_offset
=
ihsf
.
FrameOffset
;
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
name
,
sgv_cb
,
(
void
*
)
&
sgv
);
...
...
@@ -613,8 +603,7 @@ int symbol_info_locals(void)
if
(
stack_get_frame
(
si
,
&
ihsf
))
{
dbg_printf
(
"%s:
\n
"
,
si
->
Name
);
if
(
SymSetContext
(
dbg_curr_process
->
handle
,
&
ihsf
,
NULL
))
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
NULL
,
info_locals_cb
,
&
ihsf
);
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
NULL
,
info_locals_cb
,
&
ihsf
);
}
return
TRUE
;
}
...
...
programs/winedbg/winedbg.c
View file @
ae6239d5
...
...
@@ -606,7 +606,6 @@ static unsigned dbg_exception_prolog(BOOL is_debug, const EXCEPTION_RECORD* rec)
{
ADDRESS
tmp
=
addr
;
/* Show where we crashed */
stack_set_frame
(
0
);
memory_disasm_one_insn
(
&
tmp
);
}
source_list_from_addr
(
&
addr
,
0
);
...
...
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