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
cf349cea
Commit
cf349cea
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 setting a thread's context.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
23261793
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
7 deletions
+46
-7
be_arm.c
programs/winedbg/be_arm.c
+5
-0
be_arm64.c
programs/winedbg/be_arm64.c
+5
-0
be_cpu.h
programs/winedbg/be_cpu.h
+1
-0
be_i386.c
programs/winedbg/be_i386.c
+6
-0
be_ppc.c
programs/winedbg/be_ppc.c
+6
-0
be_x86_64.c
programs/winedbg/be_x86_64.c
+6
-0
gdbproxy.c
programs/winedbg/gdbproxy.c
+6
-4
tgt_active.c
programs/winedbg/tgt_active.c
+3
-3
tgt_minidump.c
programs/winedbg/tgt_minidump.c
+8
-0
No files found.
programs/winedbg/be_arm.c
View file @
cf349cea
...
...
@@ -1899,6 +1899,11 @@ static BOOL be_arm_get_context(HANDLE thread, dbg_ctx_t *ctx)
#endif
}
static
BOOL
be_arm_set_context
(
HANDLE
thread
,
const
dbg_ctx_t
*
ctx
)
{
return
SetThreadContext
(
thread
,
&
ctx
->
ctx
);
}
struct
backend_cpu
be_arm
=
{
IMAGE_FILE_MACHINE_ARMNT
,
...
...
programs/winedbg/be_arm64.c
View file @
cf349cea
...
...
@@ -288,6 +288,11 @@ static BOOL be_arm64_get_context(HANDLE thread, dbg_ctx_t *ctx)
#endif
}
static
BOOL
be_arm64_set_context
(
HANDLE
thread
,
const
dbg_ctx_t
*
ctx
)
{
return
SetThreadContext
(
thread
,
&
ctx
->
ctx
);
}
struct
backend_cpu
be_arm64
=
{
IMAGE_FILE_MACHINE_ARM64
,
...
...
programs/winedbg/be_cpu.h
View file @
cf349cea
...
...
@@ -117,6 +117,7 @@ struct backend_cpu
BOOL
(
*
store_integer
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
BOOL
is_signed
,
LONGLONG
);
BOOL
(
*
get_context
)(
HANDLE
thread
,
dbg_ctx_t
*
ctx
);
BOOL
(
*
set_context
)(
HANDLE
thread
,
const
dbg_ctx_t
*
ctx
);
};
/* some handy functions for non segmented CPUs */
...
...
programs/winedbg/be_i386.c
View file @
cf349cea
...
...
@@ -859,6 +859,11 @@ static BOOL be_i386_get_context(HANDLE thread, dbg_ctx_t *ctx)
return
Wow64GetThreadContext
(
thread
,
&
ctx
->
x86
);
}
static
BOOL
be_i386_set_context
(
HANDLE
thread
,
const
dbg_ctx_t
*
ctx
)
{
return
Wow64SetThreadContext
(
thread
,
&
ctx
->
x86
);
}
struct
backend_cpu
be_i386
=
{
IMAGE_FILE_MACHINE_I386
,
...
...
@@ -886,5 +891,6 @@ struct backend_cpu be_i386 =
be_i386_fetch_float
,
be_i386_store_integer
,
be_i386_get_context
,
be_i386_set_context
,
};
#endif
programs/winedbg/be_ppc.c
View file @
cf349cea
...
...
@@ -190,6 +190,11 @@ static BOOL be_ppc_get_context(HANDLE thread, dbg_ctx_t *ctx)
#endif
}
static
BOOL
be_ppc_set_context
(
HANDLE
thread
,
const
dbg_ctx_t
*
ctx
)
{
return
SetThreadContext
(
thread
,
&
ctx
->
ctx
);
}
struct
backend_cpu
be_ppc
=
{
IMAGE_FILE_MACHINE_POWERPC
,
...
...
@@ -217,5 +222,6 @@ struct backend_cpu be_ppc =
be_ppc_fetch_float
,
be_ppc_store_integer
,
be_ppc_get_context
,
be_ppc_set_context
,
};
#endif
programs/winedbg/be_x86_64.c
View file @
cf349cea
...
...
@@ -684,6 +684,11 @@ static BOOL be_x86_64_get_context(HANDLE thread, dbg_ctx_t *ctx)
#endif
}
static
BOOL
be_x86_64_set_context
(
HANDLE
thread
,
const
dbg_ctx_t
*
ctx
)
{
return
SetThreadContext
(
thread
,
&
ctx
->
ctx
);
}
struct
backend_cpu
be_x86_64
=
{
IMAGE_FILE_MACHINE_AMD64
,
...
...
@@ -711,5 +716,6 @@ struct backend_cpu be_x86_64 =
be_x86_64_fetch_float
,
be_x86_64_store_integer
,
be_x86_64_get_context
,
be_x86_64_set_context
,
};
#endif
programs/winedbg/gdbproxy.c
View file @
cf349cea
...
...
@@ -768,7 +768,7 @@ static void resume_debuggee(struct gdb_context* gdbctx, DWORD cont)
{
if
(
dbg_curr_thread
)
{
if
(
!
SetThreadContext
(
dbg_curr_thread
->
handle
,
&
gdbctx
->
context
.
ctx
))
if
(
!
gdbctx
->
process
->
be_cpu
->
set_context
(
dbg_curr_thread
->
handle
,
&
gdbctx
->
context
))
if
(
gdbctx
->
trace
&
GDBPXY_TRC_WIN32_ERROR
)
fprintf
(
stderr
,
"Cannot set context on thread %04x
\n
"
,
dbg_curr_thread
->
tid
);
if
(
!
ContinueDebugEvent
(
gdbctx
->
process
->
pid
,
dbg_curr_thread
->
tid
,
cont
))
...
...
@@ -788,7 +788,7 @@ static void resume_debuggee_thread(struct gdb_context* gdbctx, DWORD cont, unsig
{
if
(
dbg_curr_thread
->
tid
==
threadid
){
/* Windows debug and GDB don't seem to work well here, windows only likes ContinueDebugEvent being used on the reporter of the event */
if
(
!
SetThreadContext
(
dbg_curr_thread
->
handle
,
&
gdbctx
->
context
.
ctx
))
if
(
!
gdbctx
->
process
->
be_cpu
->
set_context
(
dbg_curr_thread
->
handle
,
&
gdbctx
->
context
))
if
(
gdbctx
->
trace
&
GDBPXY_TRC_WIN32_ERROR
)
fprintf
(
stderr
,
"Cannot set context on thread %04x
\n
"
,
dbg_curr_thread
->
tid
);
if
(
!
ContinueDebugEvent
(
gdbctx
->
process
->
pid
,
dbg_curr_thread
->
tid
,
cont
))
...
...
@@ -1478,7 +1478,8 @@ static enum packet_return packet_write_registers(struct gdb_context* gdbctx)
for
(
i
=
0
;
i
<
cpu_num_regs
;
i
++
)
cpu_register_hex_from
(
pctx
,
i
,
&
ptr
);
if
(
pctx
!=
&
gdbctx
->
context
&&
!
SetThreadContext
(
gdbctx
->
other_thread
->
handle
,
&
pctx
->
ctx
))
if
(
pctx
!=
&
gdbctx
->
context
&&
!
gdbctx
->
process
->
be_cpu
->
set_context
(
gdbctx
->
other_thread
->
handle
,
pctx
))
{
if
(
gdbctx
->
trace
&
GDBPXY_TRC_WIN32_ERROR
)
fprintf
(
stderr
,
"Cannot set context on thread %04x
\n
"
,
gdbctx
->
other_thread
->
tid
);
...
...
@@ -1677,7 +1678,8 @@ static enum packet_return packet_write_register(struct gdb_context* gdbctx)
}
cpu_register_hex_from
(
pctx
,
reg
,
(
const
char
**
)
&
ptr
);
if
(
pctx
!=
&
gdbctx
->
context
&&
!
SetThreadContext
(
gdbctx
->
other_thread
->
handle
,
&
pctx
->
ctx
))
if
(
pctx
!=
&
gdbctx
->
context
&&
!
gdbctx
->
process
->
be_cpu
->
set_context
(
gdbctx
->
other_thread
->
handle
,
pctx
))
{
if
(
gdbctx
->
trace
&
GDBPXY_TRC_WIN32_ERROR
)
fprintf
(
stderr
,
"Cannot set context for thread %04x
\n
"
,
gdbctx
->
other_thread
->
tid
);
...
...
programs/winedbg/tgt_active.c
View file @
cf349cea
...
...
@@ -344,7 +344,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
de
->
u
.
Exception
.
dwFirstChance
);
if
(
cont
&&
dbg_curr_thread
)
{
SetThreadContext
(
dbg_curr_thread
->
handle
,
&
dbg_context
.
ctx
);
dbg_curr_process
->
be_cpu
->
set_context
(
dbg_curr_thread
->
handle
,
&
dbg_context
);
}
}
break
;
...
...
@@ -527,7 +527,7 @@ static void dbg_resume_debuggee(DWORD cont)
dbg_curr_thread
->
exec_count
);
if
(
dbg_curr_thread
)
{
if
(
!
SetThreadContext
(
dbg_curr_thread
->
handle
,
&
dbg_context
.
ctx
))
if
(
!
dbg_curr_process
->
be_cpu
->
set_context
(
dbg_curr_thread
->
handle
,
&
dbg_context
))
dbg_printf
(
"Cannot set ctx on %04lx
\n
"
,
dbg_curr_tid
);
}
}
...
...
@@ -989,7 +989,7 @@ static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill)
dbg_curr_process
->
be_cpu
->
single_step
(
&
dbg_context
,
FALSE
);
if
(
dbg_curr_thread
->
in_exception
)
{
SetThreadContext
(
dbg_curr_thread
->
handle
,
&
dbg_context
.
ctx
);
dbg_curr_process
->
be_cpu
->
set_context
(
dbg_curr_thread
->
handle
,
&
dbg_context
);
ContinueDebugEvent
(
dbg_curr_pid
,
dbg_curr_tid
,
DBG_CONTINUE
);
}
}
...
...
programs/winedbg/tgt_minidump.c
View file @
cf349cea
...
...
@@ -59,6 +59,14 @@ void minidump_write(const char* file, const EXCEPTION_RECORD* rec)
MINIDUMP_EXCEPTION_INFORMATION
mei
;
EXCEPTION_POINTERS
ep
;
#ifdef __x86_64__
if
(
dbg_curr_process
->
be_cpu
->
machine
!=
IMAGE_FILE_MACHINE_AMD64
)
{
FIXME
(
"Cannot write minidump for 32-bit process using 64-bit winedbg
\n
"
);
return
;
}
#endif
hFile
=
CreateFileA
(
file
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
...
...
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