sim: check redirect path when unserialize for cpt

sim/fd_array.hh:
Add "class Process;" to forward declare Process for unserialize
function to pass in a Process object pointer.
Fix the styling issue with include files.

sim/fd_array.cc"
Add comments.

Change-Id: Ifb21eb1c7bad119028b8fd8e610a125100fde696
This commit is contained in:
studyztp
2023-08-31 11:33:45 -07:00
committed by Zhantong Qiu
parent 2a4f3f206b
commit 377c875733
2 changed files with 8 additions and 5 deletions

View File

@@ -368,7 +368,7 @@ FDArray::serialize(CheckpointOut &cp) const {
}
void
FDArray::unserialize(CheckpointIn &cp, SimObject* process_ptr) {
FDArray::unserialize(CheckpointIn &cp, Process* process_ptr) {
ScopedCheckpointSection sec(cp, "fdarray");
uint64_t size;
paramIn(cp, "size", size);
@@ -424,8 +424,9 @@ FDArray::unserialize(CheckpointIn &cp, SimObject* process_ptr) {
if (process_ptr)
{
Process* ptr = static_cast<Process*>(process_ptr);
path = ptr->checkPathRedirect(this_ffd->getFileName());
// Check if it is needed to redirect the app path to another host
// path
path = process_ptr->checkPathRedirect(this_ffd->getFileName());
}
else
{

View File

@@ -36,13 +36,15 @@
#include <map>
#include <memory>
#include <string>
#include "sim/fd_entry.hh"
#include "sim/serialize.hh"
#include "sim/sim_object.hh"
namespace gem5
{
class Process;
class FDArray : public Serializable
{
public:
@@ -117,7 +119,7 @@ class FDArray : public Serializable
* Serialization methods for file descriptors
*/
void serialize(CheckpointOut &cp) const override;
void unserialize(CheckpointIn &cp, SimObject* process_ptr );
void unserialize(CheckpointIn &cp, Process* process_ptr );
void unserialize(CheckpointIn &cp) override {
unserialize(cp, nullptr);
};