diff options
author | Prashanth Mundkur <prashanth.mundkur@gmail.com> | 2019-07-09 15:15:25 -0700 |
---|---|---|
committer | Prashanth Mundkur <prashanth.mundkur@gmail.com> | 2019-07-09 15:15:25 -0700 |
commit | 9ccecb30e1412566cfae99747945ae88d5cd433b (patch) | |
tree | 3e3532ef72dda39f8b89e31a1e481f55019e5428 /c_emulator/riscv_sim.c | |
parent | cc53e6272416ac3ba680849d0b29b0571e2bbcbd (diff) | |
download | sail-riscv-9ccecb30e1412566cfae99747945ae88d5cd433b.zip sail-riscv-9ccecb30e1412566cfae99747945ae88d5cd433b.tar.gz sail-riscv-9ccecb30e1412566cfae99747945ae88d5cd433b.tar.bz2 |
Fix shadowing of the -v option in C emulator.
Diffstat (limited to 'c_emulator/riscv_sim.c')
-rw-r--r-- | c_emulator/riscv_sim.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/c_emulator/riscv_sim.c b/c_emulator/riscv_sim.c index 5cef660..2e27837 100644 --- a/c_emulator/riscv_sim.c +++ b/c_emulator/riscv_sim.c @@ -70,18 +70,18 @@ bool config_print_mem_access = true; bool config_print_platform = true; void set_config_print(char *var, bool val) { - if (optarg == NULL || strcmp("all", optarg) == 0) { + if (var == NULL || strcmp("all", var) == 0) { config_print_instr = val; config_print_mem_access = val; config_print_reg = val; config_print_platform = val; - } else if (strcmp("instr", optarg) == 0) { + } else if (strcmp("instr", var) == 0) { config_print_instr = val; - } else if (strcmp("reg", optarg) == 0) { + } else if (strcmp("reg", var) == 0) { config_print_reg = val; - } else if (strcmp("mem", optarg) == 0) { + } else if (strcmp("mem", var) == 0) { config_print_mem_access = val; - } else if (strcmp("platform", optarg) == 0) { + } else if (strcmp("platform", var) == 0) { config_print_platform = val; } else { fprintf(stderr, "Unknown trace category: '%s' (should be instr|reg|mem|platform|all)\n", var); @@ -196,7 +196,7 @@ char *process_args(int argc, char **argv) int c, idx = 1; uint64_t ram_size = 0; while(true) { - c = getopt_long(argc, argv, "admCIispz:b:t:v:hr:T:V::v::l:", options, &idx); + c = getopt_long(argc, argv, "admCIispz:b:t:hr:T:V::v::l:", options, &idx); if (c == -1) break; switch (c) { case 'a': |