libobs: Add date/time to crash handler
This commit is contained in:
parent
39a91d749c
commit
523e1ace49
@ -16,6 +16,7 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <time.h>
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
@ -248,12 +249,20 @@ static inline void init_module_info(struct exception_handler_data *data)
|
|||||||
|
|
||||||
static inline void write_header(struct exception_handler_data *data)
|
static inline void write_header(struct exception_handler_data *data)
|
||||||
{
|
{
|
||||||
|
char date_time[80];
|
||||||
|
time_t now = time(0);
|
||||||
|
struct tm ts;
|
||||||
|
ts = *localtime(&now);
|
||||||
|
strftime(date_time, sizeof(date_time), "%Y-%m-%d, %X", &ts);
|
||||||
|
|
||||||
dstr_catf(&data->str, "Unhandled exception: %x\r\n"
|
dstr_catf(&data->str, "Unhandled exception: %x\r\n"
|
||||||
|
"Date/Time: %s\r\n"
|
||||||
"Fault address: %"PRIX64" (%s)\r\n"
|
"Fault address: %"PRIX64" (%s)\r\n"
|
||||||
"libobs version: "OBS_VERSION"\r\n"
|
"libobs version: "OBS_VERSION"\r\n"
|
||||||
"Windows version: %d.%d build %d (revision %d)\r\n"
|
"Windows version: %d.%d build %d (revision %d)\r\n"
|
||||||
"CPU: %s\r\n\r\n",
|
"CPU: %s\r\n\r\n",
|
||||||
data->exception->ExceptionRecord->ExceptionCode,
|
data->exception->ExceptionRecord->ExceptionCode,
|
||||||
|
date_time,
|
||||||
data->main_trace.instruction_ptr,
|
data->main_trace.instruction_ptr,
|
||||||
data->module_name.array,
|
data->module_name.array,
|
||||||
data->win_version.major, data->win_version.minor,
|
data->win_version.major, data->win_version.minor,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user