aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-01-15 21:54:41 +0000
committerGuy Harris <guy@alum.mit.edu>2013-01-15 21:54:41 +0000
commit05825b02cd1ea005972b80c5f8e7cf2c4fff27a0 (patch)
tree523e826dfb0129ccc793b4439284c8f86d38d019 /rawshark.c
parentf4e862fb1a763685768a25d9d567007a2cdb29f5 (diff)
Add some routines to wsutil to, at least on some platforms, add
information to crash dumps and the like. (Currently, we only handle OS X's CrashReporter, but we should do this on other platforms where this information can be added and would be helpful.) White space tweaks. svn path=/trunk/; revision=47104
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/rawshark.c b/rawshark.c
index 67bd6998e3..28275f23b8 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -66,6 +66,7 @@
#include <glib.h>
#include <epan/epan.h>
#include <epan/filesystem.h>
+#include <wsutil/crash_info.h>
#include <wsutil/privileges.h>
#include <wsutil/file_util.h>
@@ -423,6 +424,8 @@ show_version(GString *comp_info_str, GString *runtime_info_str)
int
main(int argc, char *argv[])
{
+ GString *comp_info_str;
+ GString *runtime_info_str;
char *init_progfile_dir_error;
int opt, i;
gboolean arg_error = FALSE;
@@ -451,6 +454,22 @@ main(int argc, char *argv[])
static const char optstring[] = OPTSTRING_INIT;
+ /* Assemble the compile-time version information string */
+ comp_info_str = g_string_new("Compiled ");
+ get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
+
+ /* Assemble the run-time version information string */
+ runtime_info_str = g_string_new("Running ");
+ get_runtime_version_info(runtime_info_str, NULL);
+
+ /* Add it to the information to be reported on a crash. */
+ ws_add_crash_info("Rawshark " VERSION "%s\n"
+ "\n"
+ "%s"
+ "\n"
+ "%s",
+ wireshark_svnversion, comp_info_str->str, runtime_info_str->str);
+
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
#endif /* _WIN32 */
@@ -697,15 +716,6 @@ main(int argc, char *argv[])
break;
case 'v': /* Show version and exit */
{
- GString *comp_info_str;
- GString *runtime_info_str;
- /* Assemble the compile-time version information string */
- comp_info_str = g_string_new("Compiled ");
- get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
-
- /* Assemble the run-time version information string */
- runtime_info_str = g_string_new("Running ");
- get_runtime_version_info(runtime_info_str, NULL);
show_version(comp_info_str, runtime_info_str);
g_string_free(comp_info_str, TRUE);
g_string_free(runtime_info_str, TRUE);