From a70dc125d1795c6cbc00b518a6c2500c5237fbb6 Mon Sep 17 00:00:00 2001 From: Yu-hsin Wang Date: Mon, 15 Mar 2021 17:46:39 +0800 Subject: [PATCH] sim: Add a copied symbol table for the kernel on physical address In fs simulation, the kernel is loaded to physical address first and then it would relocate itself to virtual address. The address which using by kernel symbol table is virtual address. To debug the process before kernel relocated to virutal memory, we need another copy of symbol table for physical address. Change-Id: I38107ff94b301df1a5170dd98774df88cfb02298 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43104 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- src/sim/kernel_workload.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sim/kernel_workload.cc b/src/sim/kernel_workload.cc index 434e31750d..62e94550d9 100644 --- a/src/sim/kernel_workload.cc +++ b/src/sim/kernel_workload.cc @@ -61,6 +61,13 @@ 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; + }); + + Loader::debugSymbolTable.insert(*initKernelSymtab); Loader::debugSymbolTable.insert(kernelSymtab); }