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
0ea9fe99
Commit
0ea9fe99
authored
Oct 04, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
13125b51
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
36 additions
and
75 deletions
+36
-75
Makefile.in
programs/winedbg/Makefile.in
+1
-1
break.c
programs/winedbg/break.c
+0
-1
crashdlg.c
programs/winedbg/crashdlg.c
+3
-5
db_disasm64.c
programs/winedbg/db_disasm64.c
+3
-3
dbg.y
programs/winedbg/dbg.y
+0
-3
debug.l
programs/winedbg/debug.l
+0
-1
debugger.h
programs/winedbg/debugger.h
+2
-2
expr.c
programs/winedbg/expr.c
+0
-2
gdbproxy.c
programs/winedbg/gdbproxy.c
+19
-27
info.c
programs/winedbg/info.c
+1
-3
memory.c
programs/winedbg/memory.c
+0
-4
source.c
programs/winedbg/source.c
+0
-1
stack.c
programs/winedbg/stack.c
+0
-2
symbol.c
programs/winedbg/symbol.c
+0
-1
tgt_active.c
programs/winedbg/tgt_active.c
+3
-6
tgt_minidump.c
programs/winedbg/tgt_minidump.c
+0
-3
tgt_module.c
programs/winedbg/tgt_module.c
+0
-2
types.c
programs/winedbg/types.c
+0
-1
winedbg.c
programs/winedbg/winedbg.c
+4
-7
No files found.
programs/winedbg/Makefile.in
View file @
0ea9fe99
...
...
@@ -2,7 +2,7 @@ MODULE = winedbg.exe
IMPORTS
=
dbghelp advapi32
DELAYIMPORTS
=
comdlg32 shell32 comctl32 user32 gdi32 ws2_32
EXTRADLLFLAGS
=
-mconsole
-mcygwin
EXTRADLLFLAGS
=
-mconsole
C_SRCS
=
\
be_arm.c
\
...
...
programs/winedbg/break.c
View file @
0ea9fe99
...
...
@@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "debugger.h"
#include "wine/debug.h"
...
...
programs/winedbg/crashdlg.c
View file @
0ea9fe99
...
...
@@ -26,8 +26,6 @@
#include "shellapi.h"
#include "psapi.h"
#include "wine/unicode.h"
#include "resource.h"
#define MAX_PROGRAM_NAME_LENGTH 80
...
...
@@ -79,7 +77,7 @@ static WCHAR *get_program_name(HANDLE hProcess)
return
unidentified
;
}
programname
=
strrchrW
(
image_name
,
'\\'
);
programname
=
wcsrchr
(
image_name
,
'\\'
);
if
(
programname
!=
NULL
)
programname
++
;
else
...
...
@@ -89,7 +87,7 @@ static WCHAR *get_program_name(HANDLE hProcess)
* user-friendly program name */
/* don't display a too long string to the user */
if
(
strlenW
(
programname
)
>=
MAX_PROGRAM_NAME_LENGTH
)
if
(
l
strlenW
(
programname
)
>=
MAX_PROGRAM_NAME_LENGTH
)
{
programname
[
MAX_PROGRAM_NAME_LENGTH
-
4
]
=
'.'
;
programname
[
MAX_PROGRAM_NAME_LENGTH
-
3
]
=
'.'
;
...
...
@@ -382,7 +380,7 @@ int display_crash_dialog(void)
hProcess
=
OpenProcess
(
PROCESS_QUERY_INFORMATION
,
FALSE
,
dbg_curr_pid
);
g_ProgramName
=
get_program_name
(
hProcess
);
CloseHandle
(
hProcess
);
if
(
!
strcmpW
(
g_ProgramName
,
winedeviceW
))
return
TRUE
;
if
(
!
wcscmp
(
g_ProgramName
,
winedeviceW
))
return
TRUE
;
InitCommonControlsEx
(
&
init
);
return
DialogBoxW
(
GetModuleHandleW
(
NULL
),
MAKEINTRESOURCEW
(
IDD_CRASH_DLG
),
NULL
,
crash_dlg_proc
);
}
...
...
programs/winedbg/db_disasm64.c
View file @
0ea9fe99
...
...
@@ -33,12 +33,12 @@
#include "debugger.h"
#if defined(__GNUC__) && (__GNUC__ >= 3)
static
int
(
*
db_printf
)(
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
static
int
WINAPIV
(
*
db_printf
)(
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
#else
static
int
(
*
db_printf
)(
const
char
*
format
,
...);
static
int
WINAPIV
(
*
db_printf
)(
const
char
*
format
,
...);
#endif
static
int
no_printf
(
const
char
*
format
,
...)
{
return
0
;}
static
int
WINAPIV
no_printf
(
const
char
*
format
,
...)
{
return
0
;}
typedef
DWORD_PTR
db_addr_t
;
typedef
BOOL
boolean_t
;
...
...
programs/winedbg/dbg.y
View file @
0ea9fe99
...
...
@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
programs/winedbg/debug.l
View file @
0ea9fe99
...
...
@@ -22,7 +22,6 @@
%option noinput nounput always-interactive 8bit prefix="dbg_"
%{
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
...
...
programs/winedbg/debugger.h
View file @
0ea9fe99
...
...
@@ -447,9 +447,9 @@ extern struct dbg_type types_find_type(DWORD64 linear, const char* name, enum S
extern
void
dbg_outputW
(
const
WCHAR
*
buffer
,
int
len
);
extern
const
char
*
dbg_W2A
(
const
WCHAR
*
buffer
,
unsigned
len
);
#ifdef __GNUC__
extern
int
dbg_printf
(
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
extern
int
WINAPIV
dbg_printf
(
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
#else
extern
int
dbg_printf
(
const
char
*
format
,
...);
extern
int
WINAPIV
dbg_printf
(
const
char
*
format
,
...);
#endif
extern
const
struct
dbg_internal_var
*
dbg_get_internal_var
(
const
char
*
);
extern
BOOL
dbg_interrupt_debuggee
(
void
);
...
...
programs/winedbg/expr.c
View file @
0ea9fe99
...
...
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
...
...
programs/winedbg/gdbproxy.c
View file @
0ea9fe99
...
...
@@ -24,27 +24,20 @@
* http://sources.redhat.com/gdb/onlinedocs/gdb/Maintenance-Commands.html
*/
#include "config.h"
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "winsock2.h"
#include <assert.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "debugger.h"
#include "windef.h"
#include "winbase.h"
#include "winsock2.h"
#include "tlhelp32.h"
#include "wine/exception.h"
#include "wine/debug.h"
...
...
@@ -1283,15 +1276,15 @@ static enum packet_return packet_read_register(struct gdb_context* gdbctx)
if
(
!
backend
->
get_context
(
thread
->
handle
,
&
ctx
))
return
packet_error
;
if
(
sscanf
(
gdbctx
->
in_packet
,
"%
z
x"
,
&
reg
)
!=
1
)
if
(
sscanf
(
gdbctx
->
in_packet
,
"%
I
x"
,
&
reg
)
!=
1
)
return
packet_error
;
if
(
reg
>=
backend
->
gdb_num_regs
)
{
WARN
(
"Unhandled register %
z
u
\n
"
,
reg
);
WARN
(
"Unhandled register %
I
u
\n
"
,
reg
);
return
packet_error
;
}
TRACE
(
"%
z
u => %s
\n
"
,
reg
,
wine_dbgstr_longlong
(
cpu_register
(
gdbctx
,
&
ctx
,
reg
)));
TRACE
(
"%
I
u => %s
\n
"
,
reg
,
wine_dbgstr_longlong
(
cpu_register
(
gdbctx
,
&
ctx
,
reg
)));
packet_reply_open
(
gdbctx
);
packet_reply_register_hex_to
(
gdbctx
,
&
ctx
,
reg
);
...
...
@@ -1318,18 +1311,18 @@ static enum packet_return packet_write_register(struct gdb_context* gdbctx)
return
packet_error
;
*
ptr
++
=
'\0'
;
if
(
sscanf
(
gdbctx
->
in_packet
,
"%
z
x"
,
&
reg
)
!=
1
)
if
(
sscanf
(
gdbctx
->
in_packet
,
"%
I
x"
,
&
reg
)
!=
1
)
return
packet_error
;
if
(
reg
>=
backend
->
gdb_num_regs
)
{
/* FIXME: if just the reg is above cpu_num_regs, don't tell gdb
* it wouldn't matter too much, and it fakes our support for all regs
*/
WARN
(
"Unhandled register %
z
u
\n
"
,
reg
);
WARN
(
"Unhandled register %
I
u
\n
"
,
reg
);
return
packet_ok
;
}
TRACE
(
"%
z
u <= %s
\n
"
,
reg
,
debugstr_an
(
ptr
,
(
int
)(
gdbctx
->
in_packet_len
-
(
ptr
-
gdbctx
->
in_packet
))));
TRACE
(
"%
I
u <= %s
\n
"
,
reg
,
debugstr_an
(
ptr
,
(
int
)(
gdbctx
->
in_packet_len
-
(
ptr
-
gdbctx
->
in_packet
))));
cpu_register_hex_from
(
gdbctx
,
&
ctx
,
reg
,
(
const
char
**
)
&
ptr
);
if
(
!
backend
->
set_context
(
thread
->
handle
,
&
ctx
))
...
...
@@ -1747,7 +1740,7 @@ static void packet_query_target_xml(struct gdb_context* gdbctx, struct backend_c
"</flags>"
);
}
snprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
"<reg name=
\"
%s
\"
bitsize=
\"
%
z
u
\"
"
,
snprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
"<reg name=
\"
%s
\"
bitsize=
\"
%
I
u
\"
"
,
cpu
->
gdb_register_map
[
i
].
name
,
8
*
cpu
->
gdb_register_map
[
i
].
length
);
packet_reply_add
(
gdbctx
,
buffer
);
...
...
@@ -2111,19 +2104,17 @@ static int fetch_data(struct gdb_context* gdbctx)
static
BOOL
gdb_exec
(
unsigned
port
,
unsigned
flags
)
{
char
buf
[
MAX_PATH
];
int
fd
;
const
char
*
gdb_path
,
*
tmp_path
;
FILE
*
f
;
WCHAR
tmp
[
MAX_PATH
],
buf
[
MAX_PATH
];
const
char
*
argv
[
6
];
char
*
unix_tmp
;
const
char
*
gdb_path
;
FILE
*
f
;
if
(
!
(
gdb_path
=
getenv
(
"WINE_GDB"
)))
gdb_path
=
"gdb"
;
if
(
!
(
tmp_path
=
getenv
(
"TMPDIR"
)))
tmp_path
=
"/tmp"
;
strcpy
(
buf
,
tmp_path
);
strcat
(
buf
,
"/winegdb.XXXXXX"
);
fd
=
mkstemps
(
buf
,
0
);
if
(
fd
==
-
1
)
return
FALSE
;
if
((
f
=
fdopen
(
fd
,
"w+"
))
==
NULL
)
return
FALSE
;
GetTempPathW
(
MAX_PATH
,
buf
);
GetTempFileNameW
(
buf
,
L"gdb"
,
0
,
tmp
);
if
((
f
=
_wfopen
(
tmp
,
L"w+"
))
==
NULL
)
return
FALSE
;
unix_tmp
=
wine_get_unix_file_name
(
tmp
);
fprintf
(
f
,
"target remote localhost:%d
\n
"
,
ntohs
(
port
));
fprintf
(
f
,
"set prompt Wine-gdb>
\\
\n
"
);
/* gdb 5.1 seems to require it, won't hurt anyway */
...
...
@@ -2137,18 +2128,19 @@ static BOOL gdb_exec(unsigned port, unsigned flags)
*/
fprintf
(
f
,
"set step-mode on
\n
"
);
/* tell gdb to delete this file when done handling it... */
fprintf
(
f
,
"shell rm -f
\"
%s
\"\n
"
,
buf
);
fprintf
(
f
,
"shell rm -f
\"
%s
\"\n
"
,
unix_tmp
);
fclose
(
f
);
argv
[
0
]
=
"xterm"
;
argv
[
1
]
=
"-e"
;
argv
[
2
]
=
gdb_path
;
argv
[
3
]
=
"-x"
;
argv
[
4
]
=
buf
;
argv
[
4
]
=
unix_tmp
;
argv
[
5
]
=
NULL
;
if
(
flags
&
FLAG_WITH_XTERM
)
__wine_unix_spawnvp
(
(
char
**
)
argv
,
FALSE
);
else
__wine_unix_spawnvp
(
(
char
**
)
argv
+
2
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
unix_tmp
);
return
TRUE
;
}
...
...
programs/winedbg/info.c
View file @
0ea9fe99
...
...
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
...
...
@@ -177,7 +175,7 @@ static void module_print_info(const struct info_module *module, BOOL is_embedded
is_embedded
?
"
\\
"
:
get_symtype_str
(
&
module
->
mi
),
module
->
name
);
}
static
int
module_compare
(
const
void
*
p1
,
const
void
*
p2
)
static
int
__cdecl
module_compare
(
const
void
*
p1
,
const
void
*
p2
)
{
struct
info_module
*
left
=
(
struct
info_module
*
)
p1
;
struct
info_module
*
right
=
(
struct
info_module
*
)
p2
;
...
...
programs/winedbg/memory.c
View file @
0ea9fe99
...
...
@@ -20,16 +20,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "debugger.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winedbg
);
...
...
programs/winedbg/source.c
View file @
0ea9fe99
...
...
@@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
...
...
programs/winedbg/stack.c
View file @
0ea9fe99
...
...
@@ -20,8 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
...
...
programs/winedbg/symbol.c
View file @
0ea9fe99
...
...
@@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
...
...
programs/winedbg/tgt_active.c
View file @
0ea9fe99
...
...
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
...
...
@@ -31,7 +29,6 @@
#include "winternl.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winedbg
);
...
...
@@ -308,11 +305,11 @@ void fetch_module_name(void* name_addr, void* mod_addr, WCHAR* buffer, size_t bu
/* FIXME: proper NT->Dos conversion */
static
const
WCHAR
nt_prefixW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
};
if
(
!
strncmpW
(
buffer
,
nt_prefixW
,
4
))
if
(
!
wcsncmp
(
buffer
,
nt_prefixW
,
4
))
memmove
(
buffer
,
buffer
+
4
,
(
lstrlenW
(
buffer
+
4
)
+
1
)
*
sizeof
(
WCHAR
)
);
}
else
s
nprintfW
(
buffer
,
bufsz
,
dlladdr
,
(
ULONG_PTR
)
mod_addr
);
s
wprintf
(
buffer
,
bufsz
,
dlladdr
,
(
ULONG_PTR
)
mod_addr
);
}
}
...
...
@@ -376,7 +373,7 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
if
(
!
QueryFullProcessImageNameW
(
dbg_curr_process
->
handle
,
0
,
u
.
buffer
,
&
size
))
{
static
const
WCHAR
pcspid
[]
=
{
'P'
,
'r'
,
'o'
,
'c'
,
'e'
,
's'
,
's'
,
'_'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
s
nprintfW
(
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
),
pcspid
,
dbg_curr_pid
);
s
wprintf
(
u
.
buffer
,
ARRAY_SIZE
(
u
.
buffer
),
pcspid
,
dbg_curr_pid
);
}
WINE_TRACE
(
"%04x:%04x: create process '%s'/%p @%p (%u<%u>)
\n
"
,
...
...
programs/winedbg/tgt_minidump.c
View file @
0ea9fe99
...
...
@@ -21,9 +21,6 @@
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
...
...
programs/winedbg/tgt_module.c
View file @
0ea9fe99
...
...
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
...
...
programs/winedbg/types.c
View file @
0ea9fe99
...
...
@@ -21,7 +21,6 @@
* upon which full support for datatype handling will eventually be built.
*/
#include "config.h"
#include <stdlib.h>
#include "debugger.h"
...
...
programs/winedbg/winedbg.c
View file @
0ea9fe99
...
...
@@ -17,9 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
...
...
@@ -149,15 +146,15 @@ void dbg_outputW(const WCHAR* buffer, int len)
/* FIXME: should CP_ACP be GetConsoleCP()? */
}
int
dbg_printf
(
const
char
*
format
,
...)
int
WINAPIV
dbg_printf
(
const
char
*
format
,
...)
{
static
char
buf
[
4
*
1024
];
va_list
valist
;
__ms_va_list
valist
;
int
len
;
va_start
(
valist
,
format
);
__ms_
va_start
(
valist
,
format
);
len
=
vsnprintf
(
buf
,
sizeof
(
buf
),
format
,
valist
);
va_end
(
valist
);
__ms_
va_end
(
valist
);
if
(
len
<=
-
1
||
len
>=
sizeof
(
buf
))
{
...
...
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