Fix emulator argument processing for unknown DTM arguments (#498)
Revision 7e79421 (issue #484) makes emulator.cc rejecting any unrecognized +arg "legacy" arguments, however, this breaks riscv-torture emulator tests as it needs to pass +signature to the DTM. I think it is actually impossible to check for unknown argument here unless we hardcode a list of all arguments recognized by fesrv. Fix this issue by passing all arguments starting with the first unknown argument to DTM. Updates #484. Signed-off-by: Minux Ma <minux.ma@gmail.com>
This commit is contained in:
parent
8157cf1ede
commit
622e311962
@ -118,10 +118,6 @@ int main(int argc, char** argv)
|
|||||||
// we've hit the binary. The binary is expected to be a
|
// we've hit the binary. The binary is expected to be a
|
||||||
// non-option and not start with '-' or '+'.
|
// non-option and not start with '-' or '+'.
|
||||||
case 1: {
|
case 1: {
|
||||||
if (optarg[0] != '+') {
|
|
||||||
to_dtm.push_back(optarg);
|
|
||||||
goto done_processing;
|
|
||||||
}
|
|
||||||
std::string arg = optarg;
|
std::string arg = optarg;
|
||||||
if (arg == "+verbose")
|
if (arg == "+verbose")
|
||||||
verbose = true;
|
verbose = true;
|
||||||
@ -134,9 +130,8 @@ int main(int argc, char** argv)
|
|||||||
else if (arg.substr(0, 12) == "+cycle-count")
|
else if (arg.substr(0, 12) == "+cycle-count")
|
||||||
print_cycles = true;
|
print_cycles = true;
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "%s: unrecognized option '%s'\n", argv[0], optarg);
|
to_dtm.push_back(optarg);
|
||||||
usage(argv[0]);
|
goto done_processing;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user