base: Add encapsulation to the loader::Symbol class

This commit converts `gem5::loader::Symbol` to a full class with
private members, enforcing encapsulation. Until now client code has
been able to (and does) access members directly.

This change will enable class invariants to be enforced via accessor
methods.

Change-Id: Ia0b5b080d4f656637a211808e13dce1ddca74541
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Richard Cooper
2023-11-30 09:52:53 +00:00
parent bfd25f5352
commit 2fbbdad618
17 changed files with 201 additions and 132 deletions

View File

@@ -66,8 +66,8 @@ KernelWorkload::KernelWorkload(const Params &p) : Workload(p),
kernelSymtab = kernelObj->symtab();
auto initKernelSymtab = kernelSymtab.mask(_loadAddrMask)
->offset(_loadAddrOffset)
->rename([](std::string &name) {
name = "kernel_init." + name;
->rename([](const std::string &name) {
return "kernel_init." + name;
});
loader::debugSymbolTable.insert(*initKernelSymtab);