From c9829910af8ff4995ca5e3d6ff86817257072383 Mon Sep 17 00:00:00 2001 From: YenHaoChen Date: Mon, 30 Sep 2024 08:30:42 +0800 Subject: [PATCH] Support --halted (-H) flag There is a comment about aiming at --halted but failing to achieve so. This commit provides the behavior. --- spike_main/spike.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spike_main/spike.cc b/spike_main/spike.cc index d656d64e4f..01204df073 100644 --- a/spike_main/spike.cc +++ b/spike_main/spike.cc @@ -38,7 +38,7 @@ static void help(int exit_code = 1) fprintf(stderr, " -s Command I/O via socket (use with -d)\n"); #endif fprintf(stderr, " -h, --help Print this help message\n"); - fprintf(stderr, " -H Start halted, allowing a debugger to connect\n"); + fprintf(stderr, " -H, --halted Start halted, allowing a debugger to connect\n"); fprintf(stderr, " --log= File name for option -l\n"); fprintf(stderr, " --debug-cmd= Read commands from file (use with -d)\n"); fprintf(stderr, " --isa= RISC-V ISA string [default %s]\n", DEFAULT_ISA); @@ -375,8 +375,7 @@ int main(int argc, char** argv) #endif parser.option('p', 0, 1, [&](const char* s){nprocs = atoul_nonzero_safe(s);}); parser.option('m', 0, 1, [&](const char* s){cfg.mem_layout = parse_mem_layout(s);}); - // I wanted to use --halted, but for some reason that doesn't work. - parser.option('H', 0, 0, [&](const char UNUSED *s){halted = true;}); + parser.option('H', "halted", 0, [&](const char UNUSED *s){halted = true;}); parser.option(0, "rbb-port", 1, [&](const char* s){use_rbb = true; rbb_port = atoul_safe(s);}); parser.option(0, "pc", 1, [&](const char* s){cfg.start_pc = strtoull(s, 0, 0);}); parser.option(0, "hartids", 1, [&](const char* s){