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
b572cf30
Commit
b572cf30
authored
Jun 16, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Copy the implementation of __wine_dbg_output to the PE side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0702d6b8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
7 deletions
+41
-7
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
thread.c
dlls/ntdll/thread.c
+29
-1
debug.c
dlls/ntdll/unix/debug.c
+9
-1
loader.c
dlls/ntdll/unix/loader.c
+0
-1
unixlib.h
dlls/ntdll/unixlib.h
+1
-4
debug.h
include/wine/debug.h
+1
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
b572cf30
...
...
@@ -1621,6 +1621,7 @@
@ extern -arch=i386 __wine_ldt_copy
# Debugging
@ stdcall -syscall -norelay __wine_dbg_write(ptr long)
@ cdecl -norelay __wine_dbg_get_channel_flags(ptr)
@ cdecl -norelay __wine_dbg_header(long long str)
@ cdecl -norelay __wine_dbg_output(str)
...
...
dlls/ntdll/thread.c
View file @
b572cf30
...
...
@@ -69,6 +69,22 @@ static void init_options(void)
while
(
debug_options
[
nb_debug_options
].
name
[
0
])
nb_debug_options
++
;
}
/* add a string to the output buffer */
static
int
append_output
(
struct
debug_info
*
info
,
const
char
*
str
,
size_t
len
)
{
if
(
len
>=
sizeof
(
info
->
output
)
-
info
->
out_pos
)
{
__wine_dbg_write
(
info
->
output
,
info
->
out_pos
);
info
->
out_pos
=
0
;
ERR_
(
thread
)(
"debug buffer overflow:
\n
"
);
__wine_dbg_write
(
str
,
len
);
RtlRaiseStatus
(
STATUS_BUFFER_OVERFLOW
);
}
memcpy
(
info
->
output
+
info
->
out_pos
,
str
,
len
);
info
->
out_pos
+=
len
;
return
len
;
}
/***********************************************************************
* __wine_dbg_get_channel_flags (NTDLL.@)
*
...
...
@@ -146,7 +162,19 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_
*/
int
__cdecl
__wine_dbg_output
(
const
char
*
str
)
{
return
unix_funcs
->
dbg_output
(
str
);
struct
debug_info
*
info
=
get_info
();
const
char
*
end
=
strrchr
(
str
,
'\n'
);
int
ret
=
0
;
if
(
end
)
{
ret
+=
append_output
(
info
,
str
,
end
+
1
-
str
);
__wine_dbg_write
(
info
->
output
,
info
->
out_pos
);
info
->
out_pos
=
0
;
str
=
end
+
1
;
}
if
(
*
str
)
ret
+=
append_output
(
info
,
str
,
strlen
(
str
));
return
ret
;
}
...
...
dlls/ntdll/unix/debug.c
View file @
b572cf30
...
...
@@ -250,6 +250,14 @@ const char * __cdecl __wine_dbg_strdup( const char *str )
}
/***********************************************************************
* __wine_dbg_write (NTDLL.@)
*/
int
WINAPI
__wine_dbg_write
(
const
char
*
str
,
unsigned
int
len
)
{
return
write
(
2
,
str
,
len
);
}
/***********************************************************************
* __wine_dbg_output (NTDLL.@)
*/
int
__cdecl
__wine_dbg_output
(
const
char
*
str
)
...
...
@@ -261,7 +269,7 @@ int __cdecl __wine_dbg_output( const char *str )
if
(
end
)
{
ret
+=
append_output
(
info
,
str
,
end
+
1
-
str
);
write
(
2
,
info
->
output
,
info
->
out_pos
);
__wine_dbg_write
(
info
->
output
,
info
->
out_pos
);
info
->
out_pos
=
0
;
str
=
end
+
1
;
}
...
...
dlls/ntdll/unix/loader.c
View file @
b572cf30
...
...
@@ -1850,7 +1850,6 @@ static struct unix_funcs unix_funcs =
init_builtin_dll
,
init_unix_lib
,
unwind_builtin_dll
,
__wine_dbg_output
,
};
...
...
dlls/ntdll/unixlib.h
View file @
b572cf30
...
...
@@ -26,7 +26,7 @@
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 12
2
#define NTDLL_UNIXLIB_VERSION 12
3
struct
unix_funcs
{
...
...
@@ -78,9 +78,6 @@ struct unix_funcs
NTSTATUS
(
CDECL
*
init_unix_lib
)(
void
*
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
);
NTSTATUS
(
CDECL
*
unwind_builtin_dll
)(
ULONG
type
,
struct
_DISPATCHER_CONTEXT
*
dispatch
,
CONTEXT
*
context
);
/* debugging functions */
int
(
CDECL
*
dbg_output
)(
const
char
*
str
);
};
#endif
/* __NTDLL_UNIXLIB_H */
include/wine/debug.h
View file @
b572cf30
...
...
@@ -143,6 +143,7 @@ struct __wine_debug_channel
#endif
/* !__GNUC__ && !__SUNPRO_C */
extern
int
WINAPI
__wine_dbg_write
(
const
char
*
str
,
unsigned
int
len
);
extern
unsigned
char
__cdecl
__wine_dbg_get_channel_flags
(
struct
__wine_debug_channel
*
channel
);
extern
const
char
*
__cdecl
__wine_dbg_strdup
(
const
char
*
str
);
extern
int
__cdecl
__wine_dbg_output
(
const
char
*
str
);
...
...
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