summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-07-04 08:12:12 -0300
committerpanikon <panikon@zoho.com>2014-07-04 08:12:12 -0300
commit23d6960fa80b4120a57bfadbead8042ccf6f70d5 (patch)
treebafa13ef44512f9cd712e25adbfeca4943bbe6e3 /src/plugins
parentfcaef90fd4f92d78be230f6b9f40005ced72a415 (diff)
downloadhercules-23d6960fa80b4120a57bfadbead8042ccf6f70d5.tar.gz
hercules-23d6960fa80b4120a57bfadbead8042ccf6f70d5.tar.bz2
hercules-23d6960fa80b4120a57bfadbead8042ccf6f70d5.tar.xz
hercules-23d6960fa80b4120a57bfadbead8042ccf6f70d5.zip
Added sysinfo support to Debug Help plugin
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dbghelpplug.c23
1 files changed, 10 insertions, 13 deletions
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 <stdio.h>
#include <string.h>
+#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");
}
/**