From 05825b02cd1ea005972b80c5f8e7cf2c4fff27a0 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 15 Jan 2013 21:54:41 +0000 Subject: 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 --- rawshark.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'rawshark.c') diff --git a/rawshark.c b/rawshark.c index 67bd6998e3..28275f23b8 100644 --- a/rawshark.c +++ b/rawshark.c @@ -66,6 +66,7 @@ #include #include #include +#include #include #include @@ -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); -- cgit v1.2.3