aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Zhao <jerryz123@berkeley.edu>2023-03-07 14:26:36 -0800
committerJerry Zhao <jerryz123@berkeley.edu>2023-03-07 22:24:39 -0800
commitca2b1000db77646c58b335de9230bf4e6af27e31 (patch)
tree3d9f6c36b0e04f3f608d681091f9bd1378d1f1cd
parent76a4414381a7c1e3aee54dd9457641c2b36b982a (diff)
downloadriscv-isa-sim-ca2b1000db77646c58b335de9230bf4e6af27e31.zip
riscv-isa-sim-ca2b1000db77646c58b335de9230bf4e6af27e31.tar.gz
riscv-isa-sim-ca2b1000db77646c58b335de9230bf4e6af27e31.tar.bz2
fesvr: Add --symbol-elf flag to populate htif-t::symbol_elfs
-rw-r--r--fesvr/htif.cc7
-rw-r--r--fesvr/htif.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/fesvr/htif.cc b/fesvr/htif.cc
index 7abf8b4..3f93f7b 100644
--- a/fesvr/htif.cc
+++ b/fesvr/htif.cc
@@ -345,6 +345,9 @@ void htif_t::parse_arguments(int argc, char ** argv)
case HTIF_LONG_OPTIONS_OPTIND + 6:
targs.push_back(optarg);
break;
+ case HTIF_LONG_OPTIONS_OPTIND + 7:
+ symbol_elfs.push_back(optarg);
+ break;
case '?':
if (!opterr)
break;
@@ -387,6 +390,10 @@ void htif_t::parse_arguments(int argc, char ** argv)
c = HTIF_LONG_OPTIONS_OPTIND + 6;
optarg = optarg + 17;
}
+ else if (arg.find("+symbol-elf=") == 0) {
+ c = HTIF_LONG_OPTIONS_OPTIND + 7;
+ optarg = optarg + 12;
+ }
else if (arg.find("+permissive-off") == 0) {
if (opterr)
throw std::invalid_argument("Found +permissive-off when not parsing permissively");
diff --git a/fesvr/htif.h b/fesvr/htif.h
index c6c0a9b..dd7c060 100644
--- a/fesvr/htif.h
+++ b/fesvr/htif.h
@@ -128,6 +128,8 @@ class htif_t : public chunked_memif_t
+chroot=PATH\n\
--payload=PATH Load PATH memory as an additional ELF payload\n\
+payload=PATH\n\
+ --symbol-elf=PATH Populate the symbol table with the ELF file at PATH\n\
+ +symbol-elf=PATH\n\
\n\
HOST OPTIONS (currently unsupported)\n\
--disk=DISK Add DISK device. Use a ramdisk since this isn't\n\
@@ -147,6 +149,7 @@ TARGET (RISC-V BINARY) OPTIONS\n\
{"payload", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 4 }, \
{"signature-granularity", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 5 }, \
{"target-argument", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 6 }, \
+{"symbol-elf", required_argument, 0, HTIF_LONG_OPTIONS_OPTIND + 7 }, \
{0, 0, 0, 0}
#endif // __HTIF_H