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
b517b764
Commit
b517b764
authored
Oct 23, 2001
by
Francois Gouget
Committed by
Alexandre Julliard
Oct 23, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand environment variables in "Debugger" setting.
Replace fixed-size buffers with dynamic ones.
parent
3ae80eb2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
19 deletions
+46
-19
except.c
win32/except.c
+46
-19
No files found.
win32/except.c
View file @
b517b764
...
...
@@ -197,8 +197,10 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
DWORD
bAuto
=
FALSE
;
PROCESS_INFORMATION
info
;
STARTUPINFOA
startup
;
char
buffer
[
256
];
char
format
[
256
];
char
*
cmdline
=
NULL
;
char
*
format
=
NULL
;
DWORD
format_size
;
BOOL
ret
=
FALSE
;
MESSAGE
(
"wine: Unhandled exception, starting debugger...
\n
"
);
...
...
@@ -207,9 +209,21 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
DWORD
type
;
DWORD
count
;
count
=
sizeof
(
format
);
if
(
RegQueryValueExA
(
hDbgConf
,
"Debugger"
,
0
,
&
type
,
format
,
&
count
))
format
[
0
]
=
0
;
format_size
=
0
;
if
(
!
RegQueryValueExA
(
hDbgConf
,
"Debugger"
,
0
,
&
type
,
NULL
,
&
format_size
))
{
format
=
HeapAlloc
(
GetProcessHeap
(),
0
,
format_size
);
RegQueryValueExA
(
hDbgConf
,
"Debugger"
,
0
,
&
type
,
format
,
&
format_size
);
if
(
type
==
REG_EXPAND_SZ
)
{
char
*
tmp
;
/* Expand environment variable references */
format_size
=
ExpandEnvironmentStringsA
(
format
,
NULL
,
0
);
tmp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
format_size
);
ExpandEnvironmentStringsA
(
format
,
tmp
,
format_size
);
HeapFree
(
GetProcessHeap
(),
0
,
format
);
format
=
tmp
;
}
}
count
=
sizeof
(
bAuto
);
if
(
RegQueryValueExA
(
hDbgConf
,
"Auto"
,
0
,
&
type
,
(
char
*
)
&
bAuto
,
&
count
))
...
...
@@ -224,7 +238,7 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
RegCloseKey
(
hDbgConf
);
}
else
{
/* try a default setup... */
strcpy
(
format
,
"
debugger/winedbg
%ld %ld"
);
strcpy
(
format
,
"
winedbg --debugmsg -all -- --auto
%ld %ld"
);
}
if
(
!
bAuto
)
...
...
@@ -235,30 +249,43 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
if
(
mod
)
pMessageBoxA
=
(
MessageBoxA_funcptr
)
GetProcAddress
(
mod
,
"MessageBoxA"
);
if
(
pMessageBoxA
)
{
char
buffer
[
256
];
format_exception_msg
(
epointers
,
buffer
,
sizeof
(
buffer
)
);
if
(
pMessageBoxA
(
0
,
buffer
,
"Exception raised"
,
MB_YESNO
|
MB_ICONHAND
)
==
IDNO
)
{
TRACE
(
"Killing process
\n
"
);
return
FALSE
;
goto
EXIT
;
}
}
}
TRACE
(
"Starting debugger (fmt=%s)
\n
"
,
format
);
sprintf
(
buffer
,
format
,
GetCurrentProcessId
(),
hEvent
);
memset
(
&
startup
,
0
,
sizeof
(
startup
));
startup
.
cb
=
sizeof
(
startup
);
startup
.
dwFlags
=
STARTF_USESHOWWINDOW
;
startup
.
wShowWindow
=
SW_SHOWNORMAL
;
if
(
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
TRUE
,
0
,
NULL
,
NULL
,
&
startup
,
&
info
))
{
/* wait for debugger to come up... */
WaitForSingleObject
(
hEvent
,
INFINITE
);
return
TRUE
;
if
(
format
)
{
TRACE
(
"Starting debugger (fmt=%s)
\n
"
,
format
);
cmdline
=
HeapAlloc
(
GetProcessHeap
(),
0
,
format_size
+
2
*
20
);
sprintf
(
cmdline
,
format
,
GetCurrentProcessId
(),
hEvent
);
memset
(
&
startup
,
0
,
sizeof
(
startup
));
startup
.
cb
=
sizeof
(
startup
);
startup
.
dwFlags
=
STARTF_USESHOWWINDOW
;
startup
.
wShowWindow
=
SW_SHOWNORMAL
;
if
(
CreateProcessA
(
NULL
,
cmdline
,
NULL
,
NULL
,
TRUE
,
0
,
NULL
,
NULL
,
&
startup
,
&
info
))
{
/* wait for debugger to come up... */
WaitForSingleObject
(
hEvent
,
INFINITE
);
ret
=
TRUE
;
goto
EXIT
;
}
}
else
{
cmdline
=
NULL
;
}
ERR
(
"Couldn't start debugger (%s) (%ld)
\n
"
"Read the Wine Developers Guide on how to set up winedbg or another debugger
\n
"
,
buffer
,
GetLastError
());
return
FALSE
;
debugstr_a
(
cmdline
),
GetLastError
());
EXIT:
if
(
cmdline
)
HeapFree
(
GetProcessHeap
(),
0
,
cmdline
);
if
(
format
)
HeapFree
(
GetProcessHeap
(),
0
,
format
);
return
ret
;
}
/******************************************************************
...
...
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