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
c238ec52
Commit
c238ec52
authored
Nov 29, 2005
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced stack_get_frame with a pure symbol (and no longer stackframe)
oriented API (stack_get_current_symbol). Reused the func name (stack_get_frame) for internal stack.c handling.
parent
e2bdb145
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
36 deletions
+29
-36
debugger.h
programs/winedbg/debugger.h
+1
-1
display.c
programs/winedbg/display.c
+4
-4
stack.c
programs/winedbg/stack.c
+15
-22
symbol.c
programs/winedbg/symbol.c
+9
-9
No files found.
programs/winedbg/debugger.h
View file @
c238ec52
...
...
@@ -348,9 +348,9 @@ extern void source_nuke_path(void);
extern
void
stack_info
(
void
);
extern
void
stack_backtrace
(
DWORD
threadID
);
extern
BOOL
stack_set_frame
(
int
newframe
);
extern
BOOL
stack_get_frame
(
SYMBOL_INFO
*
sym
,
IMAGEHLP_STACK_FRAME
*
ihsf
);
extern
BOOL
stack_get_current_frame
(
IMAGEHLP_STACK_FRAME
*
ihsf
);
extern
unsigned
stack_fetch_frames
(
void
);
extern
BOOL
stack_get_current_symbol
(
SYMBOL_INFO
*
sym
);
/* symbol.c */
extern
enum
sym_get_lval
symbol_get_lvalue
(
const
char
*
name
,
const
int
lineno
,
struct
dbg_lvalue
*
addr
,
BOOL
bp_disp
);
...
...
programs/winedbg/display.c
View file @
c238ec52
...
...
@@ -87,7 +87,7 @@ int display_add(struct expr *exp, int count, char format)
displaypoints
[
i
].
func
->
SizeOfStruct
=
sizeof
(
SYMBOL_INFO
);
displaypoints
[
i
].
func
->
MaxNameLen
=
sizeof
(
displaypoints
[
i
].
func_buffer
)
-
sizeof
(
*
displaypoints
[
i
].
func
);
if
(
!
stack_get_
frame
(
displaypoints
[
i
].
func
,
NULL
))
if
(
!
stack_get_
current_symbol
(
displaypoints
[
i
].
func
))
{
expr_free
(
displaypoints
[
i
].
exp
);
displaypoints
[
i
].
exp
=
NULL
;
...
...
@@ -110,7 +110,7 @@ int display_info(void)
memset
(
func
,
0
,
sizeof
(
SYMBOL_INFO
));
func
->
SizeOfStruct
=
sizeof
(
SYMBOL_INFO
);
func
->
MaxNameLen
=
sizeof
(
buffer
)
-
sizeof
(
*
func
);
if
(
!
stack_get_
frame
(
func
,
NULL
))
return
FALSE
;
if
(
!
stack_get_
current_symbol
(
func
))
return
FALSE
;
for
(
i
=
0
;
i
<
ndisplays
;
i
++
)
{
...
...
@@ -174,7 +174,7 @@ int display_print(void)
memset
(
func
,
0
,
sizeof
(
SYMBOL_INFO
));
func
->
SizeOfStruct
=
sizeof
(
SYMBOL_INFO
);
func
->
MaxNameLen
=
sizeof
(
buffer
)
-
sizeof
(
*
func
);
if
(
!
stack_get_
frame
(
func
,
NULL
))
return
FALSE
;
if
(
!
stack_get_
current_symbol
(
func
))
return
FALSE
;
for
(
i
=
0
;
i
<
ndisplays
;
i
++
)
{
...
...
@@ -243,7 +243,7 @@ int display_enable(int displaynum, int enable)
memset
(
func
,
0
,
sizeof
(
SYMBOL_INFO
));
func
->
SizeOfStruct
=
sizeof
(
SYMBOL_INFO
);
func
->
MaxNameLen
=
sizeof
(
buffer
)
-
sizeof
(
*
func
);
if
(
!
stack_get_
frame
(
func
,
NULL
))
return
FALSE
;
if
(
!
stack_get_
current_symbol
(
func
))
return
FALSE
;
--
displaynum
;
if
(
displaynum
>=
ndisplays
||
displaynum
<
0
||
...
...
programs/winedbg/stack.c
View file @
c238ec52
...
...
@@ -82,7 +82,7 @@ static BOOL stack_set_frame_internal(int newframe)
return
TRUE
;
}
static
BOOL
stack_get_frame
_internal
(
int
nf
,
IMAGEHLP_STACK_FRAME
*
ihsf
)
static
BOOL
stack_get_frame
(
int
nf
,
IMAGEHLP_STACK_FRAME
*
ihsf
)
{
ihsf
->
InstructionOffset
=
(
unsigned
long
)
memory_to_linear_addr
(
&
dbg_curr_thread
->
frames
[
nf
].
addr_pc
);
ihsf
->
FrameOffset
=
(
unsigned
long
)
memory_to_linear_addr
(
&
dbg_curr_thread
->
frames
[
nf
].
addr_frame
);
...
...
@@ -95,7 +95,7 @@ BOOL stack_get_current_frame(IMAGEHLP_STACK_FRAME* ihsf)
* If we don't have a valid backtrace, then just return.
*/
if
(
dbg_curr_thread
->
frames
==
NULL
)
return
FALSE
;
return
stack_get_frame
_internal
(
dbg_curr_thread
->
curr_frame
,
ihsf
);
return
stack_get_frame
(
dbg_curr_thread
->
curr_frame
,
ihsf
);
}
BOOL
stack_set_frame
(
int
newframe
)
...
...
@@ -108,27 +108,20 @@ BOOL stack_set_frame(int newframe)
return
TRUE
;
}
BOOL
stack_get_frame
(
SYMBOL_INFO
*
symbol
,
IMAGEHLP_STACK_FRAME
*
ihsf
)
/******************************************************************
* stack_get_current_symbol
*
* Retrieves the symbol information for the current frame element
*/
BOOL
stack_get_current_symbol
(
SYMBOL_INFO
*
symbol
)
{
DWORD64
disp
;
/*
* If we don't have a valid backtrace, then just return.
*/
if
(
dbg_curr_thread
->
frames
==
NULL
)
return
FALSE
;
/*
* If we don't know what the current function is, then we also have
* nothing to report here.
*/
if
(
!
SymFromAddr
(
dbg_curr_process
->
handle
,
(
unsigned
long
)
memory_to_linear_addr
(
&
dbg_curr_thread
->
frames
[
dbg_curr_thread
->
curr_frame
].
addr_pc
),
&
disp
,
symbol
))
return
FALSE
;
if
(
ihsf
&&
!
stack_get_current_frame
(
ihsf
))
return
FALSE
;
IMAGEHLP_STACK_FRAME
ihsf
;
DWORD64
disp
;
return
TRUE
;
if
(
!
stack_get_current_frame
(
&
ihsf
))
return
FALSE
;
return
SymFromAddr
(
dbg_curr_process
->
handle
,
ihsf
.
InstructionOffset
,
&
disp
,
symbol
);
}
/******************************************************************
* stack_fetch_frames
*
...
...
@@ -214,7 +207,7 @@ static void stack_print_addr_and_args(int nf)
print_bare_address
(
&
dbg_curr_thread
->
frames
[
nf
].
addr_pc
);
stack_get_frame
_internal
(
nf
,
&
ihsf
);
stack_get_frame
(
nf
,
&
ihsf
);
/* grab module where symbol is. If we don't have a module, we cannot print more */
im
.
SizeOfStruct
=
sizeof
(
im
);
...
...
@@ -270,7 +263,7 @@ static unsigned backtrace(void)
dbg_printf
(
")
\n
"
);
}
/* reset context to current stack frame */
stack_get_frame
_internal
(
dbg_curr_thread
->
curr_frame
,
&
ihsf
);
stack_get_frame
(
dbg_curr_thread
->
curr_frame
,
&
ihsf
);
SymSetContext
(
dbg_curr_process
->
handle
,
&
ihsf
,
NULL
);
return
nf
;
}
...
...
programs/winedbg/symbol.c
View file @
c238ec52
...
...
@@ -595,17 +595,17 @@ static BOOL CALLBACK info_locals_cb(SYMBOL_INFO* sym, ULONG size, void* ctx)
int
symbol_info_locals
(
void
)
{
IMAGEHLP_STACK_FRAME
ihsf
;
char
buffer
[
sizeof
(
SYMBOL_INFO
)
+
256
];
SYMBOL_INFO
*
si
=
(
SYMBOL_INFO
*
)
buffer
;
ADDRESS
addr
;
stack_get_current_frame
(
&
ihsf
);
addr
.
Mode
=
AddrModeFlat
;
addr
.
Offset
=
ihsf
.
InstructionOffset
;
print_address
(
&
addr
,
FALSE
);
dbg_printf
(
": (%08lx)
\n
"
,
(
DWORD_PTR
)
ihsf
.
FrameOffset
);
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
NULL
,
info_locals_cb
,
(
void
*
)(
DWORD_PTR
)
ihsf
.
FrameOffset
);
si
->
SizeOfStruct
=
sizeof
(
*
si
);
si
->
MaxNameLen
=
256
;
if
(
stack_get_frame
(
si
,
&
ihsf
))
{
dbg_printf
(
"%s:
\n
"
,
si
->
Name
);
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
NULL
,
info_locals_cb
,
&
ihsf
);
}
return
TRUE
;
}
static
BOOL
CALLBACK
symbols_info_cb
(
SYMBOL_INFO
*
sym
,
ULONG
size
,
void
*
ctx
)
...
...
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