From 23d6960fa80b4120a57bfadbead8042ccf6f70d5 Mon Sep 17 00:00:00 2001 From: panikon Date: Fri, 4 Jul 2014 08:12:12 -0300 Subject: Added sysinfo support to Debug Help plugin --- src/plugins/dbghelpplug.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c index 108922bdd..1d531574d 100644 --- a/src/plugins/dbghelpplug.c +++ b/src/plugins/dbghelpplug.c @@ -6,6 +6,7 @@ #include #include +#include "../common/sysinfo.h" #include "../common/HPMi.h" #include "../common/HPMDataCheck.h" @@ -16,14 +17,10 @@ HPExport struct hplugin_info pinfo = { "Debug Help", SERVER_TYPE_ALL, - "0.4", + "0.5", HPM_VERSION, }; -#ifndef WIN32 -#error This plugin is only compatible with windows! -#endif - ///////////////////////////////////////////////////////////////////// // Include files // @@ -109,6 +106,7 @@ typedef enum _SymTag { */ #endif /* _NO_CVCONST_H */ +struct sysinfo_interface *sysinfo; ///////////////////////////////////////////////////////////////////// // dbghelp function prototypes @@ -343,25 +341,23 @@ Dhp__PrintProcessInfo( CONTEXT* context, FILE* log_file) { - OSVERSIONINFOA oi; LPSTR cmd_line; fprintf(log_file, - "\nProcess info:\n"); + "\nProcess information:\n"); // print the command line cmd_line = GetCommandLineA(); if( cmd_line ) fprintf(log_file, - "Cmd line: %s\n", + "Command line: %s\n", cmd_line); - // print information about the OS - oi.dwOSVersionInfoSize = sizeof(oi); - GetVersionExA(&oi); + // Print system information fprintf(log_file, - "Platform: Windows OS version %d.%d build %d %s\n", - oi.dwMajorVersion, oi.dwMinorVersion, oi.dwBuildNumber, oi.szCSDVersion); + "Platform: %s\n CPU: %s\nApplication architecture: %s\nCompiler: %s\n%s: %s\n", + sysinfo->osversion(), sysinfo->cpu(), (sysinfo->is64bit())?"x64":"x86", + sysinfo->compiler(), sysinfo->vcstype(), sysinfo->vcsrevision_src()); // print the exception code if( exception ) @@ -1787,6 +1783,7 @@ static LPTOP_LEVEL_EXCEPTION_FILTER previousFilter; **/ HPExport void plugin_init (void) { previousFilter = SetUnhandledExceptionFilter(Dhp__UnhandledExceptionFilter); + sysinfo = GET_SYMBOL("sysinfo"); } /** -- cgit v1.2.3-70-g09d2