diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-01-15 21:54:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-01-15 21:54:41 +0000 |
commit | 05825b02cd1ea005972b80c5f8e7cf2c4fff27a0 (patch) | |
tree | 523e826dfb0129ccc793b4439284c8f86d38d019 /tshark.c | |
parent | f4e862fb1a763685768a25d9d567007a2cdb29f5 (diff) | |
download | wireshark-05825b02cd1ea005972b80c5f8e7cf2c4fff27a0.tar.gz |
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 'tshark.c')
-rw-r--r-- | tshark.c | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -56,6 +56,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> @@ -860,6 +861,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; gboolean arg_error = FALSE; @@ -929,6 +932,22 @@ main(int argc, char *argv[]) static const char optstring[] = OPTSTRING; + /* 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("TShark " 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); #if !GLIB_CHECK_VERSION(2,31,0) @@ -1430,15 +1449,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); |