Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
a7172a8f
Commit
a7172a8f
authored
Nov 13, 2011
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win64: report crashes
parent
17b57777
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
37 deletions
+42
-37
bin/winvlc.c
bin/winvlc.c
+42
-37
No files found.
bin/winvlc.c
View file @
a7172a8f
...
@@ -39,10 +39,8 @@
...
@@ -39,10 +39,8 @@
# include <shlobj.h>
# include <shlobj.h>
# include <wininet.h>
# include <wininet.h>
# define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1
# define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1
# ifndef _WIN64
static
void
check_crashdump
(
void
);
static
void
check_crashdump
(
void
);
LONG
WINAPI
vlc_exception_filter
(
struct
_EXCEPTION_POINTERS
*
lpExceptionInfo
);
LONG
WINAPI
vlc_exception_filter
(
struct
_EXCEPTION_POINTERS
*
lpExceptionInfo
);
# endif
#endif
#endif
#ifndef UNDER_CE
#ifndef UNDER_CE
...
@@ -173,14 +171,11 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
...
@@ -173,14 +171,11 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
argv
[
argc
]
=
NULL
;
argv
[
argc
]
=
NULL
;
LocalFree
(
wargv
);
LocalFree
(
wargv
);
# ifndef _WIN64
/* We don't know how to manage crashes on Win64 yet */
if
(
crash_handling
)
if
(
crash_handling
)
{
{
check_crashdump
();
check_crashdump
();
SetUnhandledExceptionFilter
(
vlc_exception_filter
);
SetUnhandledExceptionFilter
(
vlc_exception_filter
);
}
}
# endif
#else
/* UNDER_CE */
#else
/* UNDER_CE */
char
**
argv
,
psz_cmdline
[
wcslen
(
lpCmdLine
)
*
4
];
char
**
argv
,
psz_cmdline
[
wcslen
(
lpCmdLine
)
*
4
];
...
@@ -210,7 +205,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
...
@@ -210,7 +205,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
return
0
;
return
0
;
}
}
#if !defined( UNDER_CE )
&& !defined( _WIN64 )
#if !defined( UNDER_CE )
/* Crashdumps handling */
/* Crashdumps handling */
static
void
get_crashdump_path
(
wchar_t
*
wdir
)
static
void
get_crashdump_path
(
wchar_t
*
wdir
)
{
{
...
@@ -321,46 +316,56 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
...
@@ -321,46 +316,56 @@ LONG WINAPI vlc_exception_filter(struct _EXCEPTION_POINTERS *lpExceptionInfo)
const
CONTEXT
*
const
pContext
=
(
const
CONTEXT
*
)
lpExceptionInfo
->
ContextRecord
;
const
CONTEXT
*
const
pContext
=
(
const
CONTEXT
*
)
lpExceptionInfo
->
ContextRecord
;
const
EXCEPTION_RECORD
*
const
pException
=
(
const
EXCEPTION_RECORD
*
)
lpExceptionInfo
->
ExceptionRecord
;
const
EXCEPTION_RECORD
*
const
pException
=
(
const
EXCEPTION_RECORD
*
)
lpExceptionInfo
->
ExceptionRecord
;
/*No nested exceptions for now*/
/*No nested exceptions for now*/
fwprintf
(
fd
,
L"
\n\n
[exceptions]
\n
%08x at %
08
x"
,
pException
->
ExceptionCode
,
fwprintf
(
fd
,
L"
\n\n
[exceptions]
\n
%08x at %
p
x"
,
pException
->
ExceptionCode
,
pException
->
ExceptionAddress
);
pException
->
ExceptionAddress
);
if
(
pException
->
NumberParameters
>
0
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
pException
->
NumberParameters
;
i
++
)
fwprintf
(
fd
,
L" | %08x"
,
pException
->
ExceptionInformation
[
i
]
);
}
fwprintf
(
fd
,
L"
\n\n
[context]
\n
EDI:%08x
\n
ESI:%08x
\n
"
\
for
(
unsigned
int
i
=
0
;
i
<
pException
->
NumberParameters
;
i
++
)
"EBX:%08x
\n
EDX:%08x
\n
ECX:%08x
\n
EAX:%08x
\n
"
\
fwprintf
(
fd
,
L" | %p"
,
pException
->
ExceptionInformation
[
i
]
);
"EBP:%08x
\n
EIP:%08x
\n
ESP:%08x
\n
"
,
#ifdef WIN64
fwprintf
(
fd
,
L"
\n\n
[context]
\n
RDI:%px
\n
RSI:%px
\n
"
\
"RBX:%px
\n
RDX:%px
\n
RCX:%px
\n
RAX:%px
\n
"
\
"RBP:%px
\n
RIP:%px
\n
RSP:%px
\n
R8:%px
\n
"
\
"R9:%px
\n
R10:%px
\n
R11:%px
\n
R12:%px
\n
"
\
"R13:%px
\n
R14:%px
\n
R15:%px
\n
"
,
pContext
->
Rdi
,
pContext
->
Rsi
,
pContext
->
Rbx
,
pContext
->
Rdx
,
pContext
->
Rcx
,
pContext
->
Rax
,
pContext
->
Rbp
,
pContext
->
Rip
,
pContext
->
Rsp
,
pContext
->
R8
,
pContext
->
R9
,
pContext
->
R10
,
pContext
->
R11
,
pContext
->
R12
,
pContext
->
R13
,
pContext
->
R14
,
pContext
->
R15
);
#else
fwprintf
(
fd
,
L"
\n\n
[context]
\n
EDI:%px
\n
ESI:%px
\n
"
\
"EBX:%px
\n
EDX:%px
\n
ECX:%px
\n
EAX:%px
\n
"
\
"EBP:%px
\n
EIP:%px
\n
ESP:%px
\n
"
,
pContext
->
Edi
,
pContext
->
Esi
,
pContext
->
Ebx
,
pContext
->
Edi
,
pContext
->
Esi
,
pContext
->
Ebx
,
pContext
->
Edx
,
pContext
->
Ecx
,
pContext
->
Eax
,
pContext
->
Edx
,
pContext
->
Ecx
,
pContext
->
Eax
,
pContext
->
Ebp
,
pContext
->
Eip
,
pContext
->
Esp
);
pContext
->
Ebp
,
pContext
->
Eip
,
pContext
->
Esp
);
#endif
fwprintf
(
fd
,
L"
\n
[stacktrace]
\n
#EIP|base|module
\n
"
);
fwprintf
(
fd
,
L"
\n
[stacktrace]
\n
#EIP|base|module
\n
"
);
#ifdef WIN64
LPCVOID
caller
=
(
LPCVOID
)
pContext
->
Rip
;
LPVOID
*
pBase
=
(
LPVOID
*
)
pContext
->
Rbp
;
#else
LPVOID
*
pBase
=
(
LPVOID
*
)
pContext
->
Ebp
;
LPCVOID
caller
=
(
LPCVOID
)
pContext
->
Eip
;
#endif
for
(
unsigned
frame
=
0
;
frame
<=
100
;
frame
++
)
{
MEMORY_BASIC_INFORMATION
mbi
;
wchar_t
module
[
256
];
wchar_t
module
[
256
];
MEMORY_BASIC_INFORMATION
mbi
;
VirtualQuery
(
caller
,
&
mbi
,
sizeof
(
mbi
)
)
;
VirtualQuery
(
(
DWORD
*
)
pContext
->
Eip
,
&
mbi
,
sizeof
(
mbi
)
)
;
GetModuleFileName
(
mbi
.
AllocationBase
,
module
,
256
);
HINSTANCE
hInstance
=
mbi
.
AllocationBase
;
fwprintf
(
fd
,
L"%p|%s
\n
"
,
caller
,
module
);
GetModuleFileName
(
hInstance
,
module
,
256
)
;
fwprintf
(
fd
,
L"%08x|%s
\n
"
,
pContext
->
Eip
,
module
);
DWORD
pEbp
=
pContext
->
Ebp
;
DWORD
caller
=
*
((
DWORD
*
)
pEbp
+
1
);
unsigned
i_line
=
0
;
/*The last BP points to NULL!*/
do
caller
=
*
(
pBase
+
1
);
{
if
(
!
caller
)
VirtualQuery
(
(
DWORD
*
)
caller
,
&
mbi
,
sizeof
(
mbi
)
)
;
break
;
HINSTANCE
hInstance
=
mbi
.
AllocationBase
;
pBase
=
*
pBase
;
GetModuleFileName
(
hInstance
,
module
,
256
)
;
}
fwprintf
(
fd
,
L"%08x|%s
\n
"
,
caller
,
module
);
pEbp
=
*
(
DWORD
*
)
pEbp
;
caller
=
*
((
DWORD
*
)
pEbp
+
1
)
;
i_line
++
;
/*The last EBP points to NULL!*/
}
while
(
caller
&&
i_line
<
100
);
fclose
(
fd
);
fclose
(
fd
);
fflush
(
stderr
);
fflush
(
stderr
);
...
...
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