summaryrefslogtreecommitdiff
path: root/src/config/cmd_args.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/cmd_args.c')
-rw-r--r--src/config/cmd_args.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/config/cmd_args.c b/src/config/cmd_args.c
index bb5a779..1b54ce9 100644
--- a/src/config/cmd_args.c
+++ b/src/config/cmd_args.c
@@ -30,6 +30,7 @@ static const sapp_cmd_args_usage_t cmd_args_usage[] =
{
{"-h", "help", NULL, "show help message"},
{"-v", "version", NULL, "show platform version"},
+ {"-g", "coredump", NULL, "generate coredump for test"},
{"-c", "sample-config", NULL, "generate sample config file->sapp.toml"},
{"-d", "dumpfile", NULL, "running as pcap dumpfile mode"},
{"-r", "dumpfile-file", NULL, "read packets from which pcap file"},
@@ -38,7 +39,7 @@ static const sapp_cmd_args_usage_t cmd_args_usage[] =
};
/* ��ֻ̬��ȫ�ֱ������Է����κδ����, ������sapp_global_val�� */
-static const char *sapp_cla_short_options = "cdhr:v";
+static const char *sapp_cla_short_options = "cdhr:vg";
/* ��ֻ̬��ȫ�ֱ������Է����κδ����, ������sapp_global_val�� */
static const struct option sapp_cla_long_options[] =
@@ -49,6 +50,7 @@ static const struct option sapp_cla_long_options[] =
{"dumpfile-file", required_argument, NULL, 'r'},
{"dumpfile-speed", required_argument, NULL, 0},
{"sample-config", no_argument, NULL, 'c'},
+ {"coredump", no_argument, NULL, 'g'},
{NULL, 0, NULL, 0}
};
@@ -239,7 +241,13 @@ int sapp_parse_cmd_args(int argc, char *argv[])
case 'd':
store_cmd_args("dumpfile", NULL);
continue;
- break;
+ break;
+
+ case 'g':
+ sapp_init_breakpad_mini();
+ sapp_segv_generate();
+ continue;
+ break;
case 'r':
store_cmd_args("dumpfile-file", optarg);