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
23261793
Commit
23261793
authored
Jun 12, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Add a backend-specific vector for retrieving a thread's context.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
45e06545
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
17 deletions
+57
-17
be_arm.c
programs/winedbg/be_arm.c
+11
-0
be_arm64.c
programs/winedbg/be_arm64.c
+11
-0
be_cpu.h
programs/winedbg/be_cpu.h
+3
-0
be_i386.c
programs/winedbg/be_i386.c
+7
-0
be_ppc.c
programs/winedbg/be_ppc.c
+11
-0
be_x86_64.c
programs/winedbg/be_x86_64.c
+11
-0
gdbproxy.c
programs/winedbg/gdbproxy.c
+1
-1
stack.c
programs/winedbg/stack.c
+1
-3
tgt_active.c
programs/winedbg/tgt_active.c
+1
-13
No files found.
programs/winedbg/be_arm.c
View file @
23261793
...
...
@@ -1889,6 +1889,16 @@ static BOOL be_arm_store_integer(const struct dbg_lvalue* lvalue, unsigned size,
return
memory_write_value
(
lvalue
,
size
,
&
val
);
}
static
BOOL
be_arm_get_context
(
HANDLE
thread
,
dbg_ctx_t
*
ctx
)
{
#ifdef __arm__
ctx
->
ctx
.
ContextFlags
=
CONTEXT_ALL
;
return
GetThreadContext
(
thread
,
&
ctx
->
ctx
);
#else
WINE_FIXME
(
"Cannot debug an ARM process on this architecture.
\n
"
);
#endif
}
struct
backend_cpu
be_arm
=
{
IMAGE_FILE_MACHINE_ARMNT
,
...
...
@@ -1915,5 +1925,6 @@ struct backend_cpu be_arm =
be_arm_fetch_integer
,
be_arm_fetch_float
,
be_arm_store_integer
,
be_arm_get_context
,
};
#endif
programs/winedbg/be_arm64.c
View file @
23261793
...
...
@@ -278,6 +278,16 @@ void be_arm64_disasm_one_insn(ADDRESS64 *addr, int display)
dbg_printf
(
"be_arm64_disasm_one_insn: not done
\n
"
);
}
static
BOOL
be_arm64_get_context
(
HANDLE
thread
,
dbg_ctx_t
*
ctx
)
{
#ifdef __aarch64__
ctx
->
ctx
.
ContextFlags
=
CONTEXT_ALL
;
return
GetThreadContext
(
thread
,
&
ctx
->
ctx
);
#else
WINE_FIXME
(
"Cannot debug an ARM64 process on this architecture.
\n
"
);
#endif
}
struct
backend_cpu
be_arm64
=
{
IMAGE_FILE_MACHINE_ARM64
,
...
...
@@ -304,5 +314,6 @@ struct backend_cpu be_arm64 =
be_arm64_fetch_integer
,
be_arm64_fetch_float
,
be_arm64_store_integer
,
be_arm64_get_context
,
};
#endif
programs/winedbg/be_cpu.h
View file @
23261793
...
...
@@ -21,6 +21,7 @@
enum
be_cpu_addr
{
be_cpu_addr_pc
,
be_cpu_addr_stack
,
be_cpu_addr_frame
};
enum
be_xpoint_type
{
be_xpoint_break
,
be_xpoint_watch_exec
,
be_xpoint_watch_read
,
be_xpoint_watch_write
,
be_xpoint_free
=-
1
};
struct
backend_cpu
{
const
DWORD
machine
;
...
...
@@ -114,6 +115,8 @@ struct backend_cpu
BOOL
(
*
fetch_float
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
long
double
*
);
/* Writes an integer to memory */
BOOL
(
*
store_integer
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
BOOL
is_signed
,
LONGLONG
);
BOOL
(
*
get_context
)(
HANDLE
thread
,
dbg_ctx_t
*
ctx
);
};
/* some handy functions for non segmented CPUs */
...
...
programs/winedbg/be_i386.c
View file @
23261793
...
...
@@ -853,6 +853,12 @@ static BOOL be_i386_store_integer(const struct dbg_lvalue* lvalue, unsigned size
return
memory_write_value
(
lvalue
,
size
,
&
val
);
}
static
BOOL
be_i386_get_context
(
HANDLE
thread
,
dbg_ctx_t
*
ctx
)
{
ctx
->
x86
.
ContextFlags
=
WOW64_CONTEXT_ALL
;
return
Wow64GetThreadContext
(
thread
,
&
ctx
->
x86
);
}
struct
backend_cpu
be_i386
=
{
IMAGE_FILE_MACHINE_I386
,
...
...
@@ -879,5 +885,6 @@ struct backend_cpu be_i386 =
be_i386_fetch_integer
,
be_i386_fetch_float
,
be_i386_store_integer
,
be_i386_get_context
,
};
#endif
programs/winedbg/be_ppc.c
View file @
23261793
...
...
@@ -180,6 +180,16 @@ static BOOL be_ppc_store_integer(const struct dbg_lvalue* lvalue, unsigned size,
return
FALSE
;
}
static
BOOL
be_ppc_get_context
(
HANDLE
thread
,
dbg_ctx_t
*
ctx
)
{
#ifdef __powerpc__
ctx
->
ctx
.
ContextFlags
=
CONTEXT_ALL
;
return
GetThreadContext
(
thread
,
&
ctx
->
ctx
);
#else
WINE_FIXME
(
"Cannot debug a PowerPC process on this architecture.
\n
"
);
#endif
}
struct
backend_cpu
be_ppc
=
{
IMAGE_FILE_MACHINE_POWERPC
,
...
...
@@ -206,5 +216,6 @@ struct backend_cpu be_ppc =
be_ppc_fetch_integer
,
be_ppc_fetch_float
,
be_ppc_store_integer
,
be_ppc_get_context
,
};
#endif
programs/winedbg/be_x86_64.c
View file @
23261793
...
...
@@ -674,6 +674,16 @@ static BOOL be_x86_64_store_integer(const struct dbg_lvalue* lvalue, unsigned si
return
memory_write_value
(
lvalue
,
size
,
&
val
);
}
static
BOOL
be_x86_64_get_context
(
HANDLE
thread
,
dbg_ctx_t
*
ctx
)
{
#ifdef __x86_64__
ctx
->
ctx
.
ContextFlags
=
CONTEXT_ALL
;
return
GetThreadContext
(
thread
,
&
ctx
->
ctx
);
#else
WINE_FIXME
(
"Cannot debug an x86-64 process on this architecture.
\n
"
);
#endif
}
struct
backend_cpu
be_x86_64
=
{
IMAGE_FILE_MACHINE_AMD64
,
...
...
@@ -700,5 +710,6 @@ struct backend_cpu be_x86_64 =
be_x86_64_fetch_integer
,
be_x86_64_fetch_float
,
be_x86_64_store_integer
,
be_x86_64_get_context
,
};
#endif
programs/winedbg/gdbproxy.c
View file @
23261793
...
...
@@ -552,7 +552,7 @@ static inline void cpu_register_hex_from(dbg_ctx_t* ctx, unsigned idx, const cha
static
BOOL
fetch_context
(
struct
gdb_context
*
gdbctx
,
HANDLE
h
,
dbg_ctx_t
*
ctx
)
{
if
(
!
GetThreadContext
(
h
,
&
ctx
->
ctx
))
if
(
!
gdbctx
->
process
->
be_cpu
->
get_context
(
h
,
ctx
))
{
if
(
gdbctx
->
trace
&
GDBPXY_TRC_WIN32_ERROR
)
fprintf
(
stderr
,
"Can't get thread's context
\n
"
);
...
...
programs/winedbg/stack.c
View file @
23261793
...
...
@@ -354,11 +354,9 @@ static void backtrace_tid(struct dbg_process* pcs, DWORD tid)
dbg_ctx_t
ctx
=
{
0
};
dbg_curr_tid
=
dbg_curr_thread
->
tid
;
ctx
.
ctx
.
ContextFlags
=
CONTEXT_FULL
;
if
(
SuspendThread
(
dbg_curr_thread
->
handle
)
!=
-
1
)
{
if
(
!
GetThreadContext
(
dbg_curr_thread
->
handle
,
&
ctx
.
ctx
))
if
(
!
pcs
->
be_cpu
->
get_context
(
dbg_curr_thread
->
handle
,
&
ctx
))
{
dbg_printf
(
"Can't get context for thread %04x in current process
\n
"
,
tid
);
...
...
programs/winedbg/tgt_active.c
View file @
23261793
...
...
@@ -91,19 +91,7 @@ BOOL dbg_attach_debuggee(DWORD pid, BOOL cofe)
static
unsigned
dbg_fetch_context
(
void
)
{
dbg_context
.
ctx
.
ContextFlags
=
CONTEXT_CONTROL
|
CONTEXT_INTEGER
#ifdef CONTEXT_FLOATING_POINT
|
CONTEXT_FLOATING_POINT
#endif
#ifdef CONTEXT_SEGMENTS
|
CONTEXT_SEGMENTS
#endif
#ifdef CONTEXT_DEBUG_REGISTERS
|
CONTEXT_DEBUG_REGISTERS
#endif
;
if
(
!
GetThreadContext
(
dbg_curr_thread
->
handle
,
&
dbg_context
.
ctx
))
if
(
!
dbg_curr_process
->
be_cpu
->
get_context
(
dbg_curr_thread
->
handle
,
&
dbg_context
))
{
WINE_WARN
(
"Can't get thread's context
\n
"
);
return
FALSE
;
...
...
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