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
Lorenzo Ferrillo
wine
Commits
7af9179e
Commit
7af9179e
authored
13 years ago
by
André Zwing
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dbghelp: Implement rudimentary stack walk for ARM.
parent
518675fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/dbghelp/cpu_arm.c
+108
-3
108 additions, 3 deletions
dlls/dbghelp/cpu_arm.c
with
108 additions
and
3 deletions
dlls/dbghelp/cpu_arm.c
+
108
−
3
View file @
7af9179e
/*
* File cpu_arm.c
*
* Copyright (C) 2009
-2009,
Eric Pouech
* Copyright (C) 2010, André Hentschel
* Copyright (C) 2009 Eric Pouech
* Copyright (C) 2010,
2011
André Hentschel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -46,11 +46,116 @@ static unsigned arm_get_addr(HANDLE hThread, const CONTEXT* ctx,
}
}
#ifdef __arm__
enum
st_mode
{
stm_start
,
stm_arm
,
stm_done
};
/* indexes in Reserved array */
#define __CurrentModeCount 0
#define curr_mode (frame->Reserved[__CurrentModeCount] & 0x0F)
#define curr_count (frame->Reserved[__CurrentModeCount] >> 4)
#define set_curr_mode(m) {frame->Reserved[__CurrentModeCount] &= ~0x0F; frame->Reserved[__CurrentModeCount] |= (m & 0x0F);}
#define inc_curr_count() (frame->Reserved[__CurrentModeCount] += 0x10)
/* fetch_next_frame()
*
* modify (at least) context.Pc using unwind information
* either out of debug info (dwarf), or simple Lr trace
*/
static
BOOL
fetch_next_frame
(
struct
cpu_stack_walk
*
csw
,
CONTEXT
*
context
,
DWORD_PTR
curr_pc
)
{
DWORD_PTR
xframe
;
DWORD
oldReturn
=
context
->
Lr
;
if
(
dwarf2_virtual_unwind
(
csw
,
curr_pc
,
context
,
&
xframe
))
{
context
->
Sp
=
xframe
;
context
->
Pc
=
oldReturn
;
return
TRUE
;
}
if
(
context
->
Pc
==
context
->
Lr
)
return
FALSE
;
context
->
Pc
=
oldReturn
;
return
TRUE
;
}
static
BOOL
arm_stack_walk
(
struct
cpu_stack_walk
*
csw
,
LPSTACKFRAME64
frame
,
CONTEXT
*
context
)
{
unsigned
deltapc
=
curr_count
<=
1
?
0
:
4
;
/* sanity check */
if
(
curr_mode
>=
stm_done
)
return
FALSE
;
TRACE
(
"Enter: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s
\n
"
,
wine_dbgstr_addr
(
&
frame
->
AddrPC
),
wine_dbgstr_addr
(
&
frame
->
AddrFrame
),
wine_dbgstr_addr
(
&
frame
->
AddrReturn
),
wine_dbgstr_addr
(
&
frame
->
AddrStack
),
curr_mode
==
stm_start
?
"start"
:
"ARM"
,
wine_dbgstr_longlong
(
curr_count
));
if
(
curr_mode
==
stm_start
)
{
if
((
frame
->
AddrPC
.
Mode
==
AddrModeFlat
)
&&
(
frame
->
AddrFrame
.
Mode
!=
AddrModeFlat
))
{
WARN
(
"Bad AddrPC.Mode / AddrFrame.Mode combination
\n
"
);
goto
done_err
;
}
/* Init done */
set_curr_mode
(
stm_arm
);
frame
->
AddrReturn
.
Mode
=
frame
->
AddrStack
.
Mode
=
AddrModeFlat
;
/* don't set up AddrStack on first call. Either the caller has set it up, or
* we will get it in the next frame
*/
memset
(
&
frame
->
AddrBStore
,
0
,
sizeof
(
frame
->
AddrBStore
));
}
else
{
if
(
context
->
Sp
!=
frame
->
AddrStack
.
Offset
)
FIXME
(
"inconsistent Stack Pointer
\n
"
);
if
(
context
->
Pc
!=
frame
->
AddrPC
.
Offset
)
FIXME
(
"inconsistent Program Counter
\n
"
);
if
(
frame
->
AddrReturn
.
Offset
==
0
)
goto
done_err
;
if
(
!
fetch_next_frame
(
csw
,
context
,
frame
->
AddrPC
.
Offset
-
deltapc
))
goto
done_err
;
}
memset
(
&
frame
->
Params
,
0
,
sizeof
(
frame
->
Params
));
/* set frame information */
frame
->
AddrStack
.
Offset
=
context
->
Sp
;
frame
->
AddrReturn
.
Offset
=
context
->
Lr
;
frame
->
AddrFrame
.
Offset
=
context
->
Fp
;
frame
->
AddrPC
.
Offset
=
context
->
Pc
;
frame
->
Far
=
TRUE
;
frame
->
Virtual
=
TRUE
;
inc_curr_count
();
TRACE
(
"Leave: PC=%s Frame=%s Return=%s Stack=%s Mode=%s Count=%s FuncTable=%p
\n
"
,
wine_dbgstr_addr
(
&
frame
->
AddrPC
),
wine_dbgstr_addr
(
&
frame
->
AddrFrame
),
wine_dbgstr_addr
(
&
frame
->
AddrReturn
),
wine_dbgstr_addr
(
&
frame
->
AddrStack
),
curr_mode
==
stm_start
?
"start"
:
"ARM"
,
wine_dbgstr_longlong
(
curr_count
),
frame
->
FuncTableEntry
);
return
TRUE
;
done_err:
set_curr_mode
(
stm_done
);
return
FALSE
;
}
#else
static
BOOL
arm_stack_walk
(
struct
cpu_stack_walk
*
csw
,
LPSTACKFRAME64
frame
,
CONTEXT
*
context
)
{
FIXME
(
"not done for ARM
\n
"
);
return
FALSE
;
}
#endif
static
unsigned
arm_map_dwarf_register
(
unsigned
regno
)
{
...
...
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