Alexandre Julliard : winedbg: Append some system information to the crash log.

Alexandre Julliard julliard at winehq.org
Tue Jan 17 13:45:30 CST 2012


Module: wine
Branch: master
Commit: 2533c1287eb6b389a35816e3936dd85b36a8217a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2533c1287eb6b389a35816e3936dd85b36a8217a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jan 17 19:11:07 2012 +0100

winedbg: Append some system information to the crash log.

---

 programs/winedbg/tgt_active.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index af8e256..c71974d 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -678,6 +678,42 @@ static HANDLE create_temp_file(void)
                         NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0 );
 }
 
+static void output_system_info(void)
+{
+#ifdef __i386__
+    static const char platform[] = "i386";
+#elif defined(__x86_64__)
+    static const char platform[] = "x86_64";
+#elif defined(__sparc__)
+    static const char platform[] = "sparc";
+#elif defined(__powerpc__)
+    static const char platform[] = "powerpc";
+#elif defined(__arm__)
+    static const char platform[] = "arm";
+#else
+# error CPU unknown
+#endif
+
+    const char *(CDECL *wine_get_build_id)(void);
+    void (CDECL *wine_get_host_version)( const char **sysname, const char **release );
+    BOOL is_wow64;
+
+    wine_get_build_id = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_build_id");
+    wine_get_host_version = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_host_version");
+    if (!IsWow64Process( dbg_curr_process->handle, &is_wow64 )) is_wow64 = FALSE;
+
+    dbg_printf( "System information:\n" );
+    if (wine_get_build_id) dbg_printf( "    Wine build: %s\n", wine_get_build_id() );
+    dbg_printf( "    Platform: %s%s\n", platform, is_wow64 ? " (WOW64)" : "" );
+    if (wine_get_host_version)
+    {
+        const char *sysname, *release;
+        wine_get_host_version( &sysname, &release );
+        dbg_printf( "    Host system: %s\n", sysname );
+        dbg_printf( "    Host version: %s\n", release );
+    }
+}
+
 /******************************************************************
  *		dbg_active_attach
  *
@@ -801,6 +837,7 @@ enum dbg_start dbg_active_auto(int argc, char* argv[])
 
     if (output != INVALID_HANDLE_VALUE)
     {
+        output_system_info();
         display_crash_details( output );
         CloseHandle( output );
     }




More information about the wine-cvs mailing list