64d63
< #include "params/LiveProcess.hh"
129c128
< Process::Process(ProcessParams * params)
---
> Process::Process(ProcessParams * params, ObjectFile * obj_file)
150a150,152
> objFile(obj_file),
> argv(params->cmd), envp(params->env), cwd(params->cwd),
> executable(params->executable),
153c155,156
< _pid(params->pid), _ppid(params->ppid)
---
> _pid(params->pid), _ppid(params->ppid),
> drivers(params->drivers)
190a194,206
>
> // load up symbols, if any... these may be used for debugging or
> // profiling.
> if (!debugSymbolTable) {
> debugSymbolTable = new SymbolTable();
> if (!objFile->loadGlobalSymbols(debugSymbolTable) ||
> !objFile->loadLocalSymbols(debugSymbolTable) ||
> !objFile->loadWeakSymbols(debugSymbolTable)) {
> // didn't load any symbols
> delete debugSymbolTable;
> debugSymbolTable = NULL;
> }
> }
499,526d514
< ////////////////////////////////////////////////////////////////////////
< //
< // LiveProcess member definitions
< //
< ////////////////////////////////////////////////////////////////////////
<
<
< LiveProcess::LiveProcess(LiveProcessParams *params, ObjectFile *_objFile)
< : Process(params), objFile(_objFile),
< argv(params->cmd), envp(params->env), cwd(params->cwd),
< executable(params->executable),
< drivers(params->drivers)
< {
<
< // load up symbols, if any... these may be used for debugging or
< // profiling.
< if (!debugSymbolTable) {
< debugSymbolTable = new SymbolTable();
< if (!objFile->loadGlobalSymbols(debugSymbolTable) ||
< !objFile->loadLocalSymbols(debugSymbolTable) ||
< !objFile->loadWeakSymbols(debugSymbolTable)) {
< // didn't load any symbols
< delete debugSymbolTable;
< debugSymbolTable = NULL;
< }
< }
< }
<
528c516
< LiveProcess::syscall(int64_t callnum, ThreadContext *tc)
---
> Process::syscall(int64_t callnum, ThreadContext *tc)
540c528
< LiveProcess::getSyscallArg(ThreadContext *tc, int &i, int width)
---
> Process::getSyscallArg(ThreadContext *tc, int &i, int width)
547c535
< LiveProcess::findDriver(std::string filename)
---
> Process::findDriver(std::string filename)
558c546
< LiveProcess::updateBias()
---
> Process::updateBias()
583c571
< LiveProcess::getInterpreter()
---
> Process::getInterpreter()
590c578
< LiveProcess::getBias()
---
> Process::getBias()
599c587
< LiveProcess::getStartPC()
---
> Process::getStartPC()
607,608c595,596
< LiveProcess *
< LiveProcess::create(LiveProcessParams * params)
---
> Process *
> ProcessParams::create()
610c598
< LiveProcess *process = NULL;
---
> Process *process = NULL;
614,615c602,603
< if (params->executable == "") {
< params->executable = params->cmd[0];
---
> if (executable == "") {
> executable = cmd[0];
618,620c606,608
< ObjectFile *objFile = createObjectFile(params->executable);
< if (objFile == NULL) {
< fatal("Can't load object file %s", params->executable);
---
> ObjectFile *obj_file = createObjectFile(executable);
> if (obj_file == NULL) {
> fatal("Can't load object file %s", executable);
624c612
< if (objFile->getArch() != ObjectFile::Alpha)
---
> if (obj_file->getArch() != ObjectFile::Alpha)
627c615
< switch (objFile->getOpSys()) {
---
> switch (obj_file->getOpSys()) {
632c620
< process = new AlphaLinuxProcess(params, objFile);
---
> process = new AlphaLinuxProcess(this, obj_file);
639,640c627,628
< if (objFile->getArch() != ObjectFile::SPARC64 &&
< objFile->getArch() != ObjectFile::SPARC32)
---
> if (obj_file->getArch() != ObjectFile::SPARC64 &&
> obj_file->getArch() != ObjectFile::SPARC32)
642c630
< switch (objFile->getOpSys()) {
---
> switch (obj_file->getOpSys()) {
647,648c635,636
< if (objFile->getArch() == ObjectFile::SPARC64) {
< process = new Sparc64LinuxProcess(params, objFile);
---
> if (obj_file->getArch() == ObjectFile::SPARC64) {
> process = new Sparc64LinuxProcess(this, obj_file);
650c638
< process = new Sparc32LinuxProcess(params, objFile);
---
> process = new Sparc32LinuxProcess(this, obj_file);
656c644
< process = new SparcSolarisProcess(params, objFile);
---
> process = new SparcSolarisProcess(this, obj_file);
663,664c651,652
< if (objFile->getArch() != ObjectFile::X86_64 &&
< objFile->getArch() != ObjectFile::I386)
---
> if (obj_file->getArch() != ObjectFile::X86_64 &&
> obj_file->getArch() != ObjectFile::I386)
666c654
< switch (objFile->getOpSys()) {
---
> switch (obj_file->getOpSys()) {
671,672c659,660
< if (objFile->getArch() == ObjectFile::X86_64) {
< process = new X86_64LinuxProcess(params, objFile);
---
> if (obj_file->getArch() == ObjectFile::X86_64) {
> process = new X86_64LinuxProcess(this, obj_file);
674c662
< process = new I386LinuxProcess(params, objFile);
---
> process = new I386LinuxProcess(this, obj_file);
682c670
< if (objFile->getArch() != ObjectFile::Mips)
---
> if (obj_file->getArch() != ObjectFile::Mips)
684c672
< switch (objFile->getOpSys()) {
---
> switch (obj_file->getOpSys()) {
689c677
< process = new MipsLinuxProcess(params, objFile);
---
> process = new MipsLinuxProcess(this, obj_file);
696c684
< ObjectFile::Arch arch = objFile->getArch();
---
> ObjectFile::Arch arch = obj_file->getArch();
700c688
< switch (objFile->getOpSys()) {
---
> switch (obj_file->getOpSys()) {
706,707c694,695
< process = new ArmLinuxProcess64(params, objFile,
< objFile->getArch());
---
> process = new ArmLinuxProcess64(this, obj_file,
> obj_file->getArch());
709,710c697,698
< process = new ArmLinuxProcess32(params, objFile,
< objFile->getArch());
---
> process = new ArmLinuxProcess32(this, obj_file,
> obj_file->getArch());
715,716c703,704
< process = new ArmFreebsdProcess64(params, objFile,
< objFile->getArch());
---
> process = new ArmFreebsdProcess64(this, obj_file,
> obj_file->getArch());
718,719c706,707
< process = new ArmFreebsdProcess32(params, objFile,
< objFile->getArch());
---
> process = new ArmFreebsdProcess32(this, obj_file,
> obj_file->getArch());
729c717
< if (objFile->getArch() != ObjectFile::Power)
---
> if (obj_file->getArch() != ObjectFile::Power)
731c719
< switch (objFile->getOpSys()) {
---
> switch (obj_file->getOpSys()) {
736c724
< process = new PowerLinuxProcess(params, objFile);
---
> process = new PowerLinuxProcess(this, obj_file);
743c731
< if (objFile->getArch() != ObjectFile::Riscv)
---
> if (obj_file->getArch() != ObjectFile::Riscv)
745c733
< switch (objFile->getOpSys()) {
---
> switch (obj_file->getOpSys()) {
750c738
< process = new RiscvLinuxProcess(params, objFile);
---
> process = new RiscvLinuxProcess(this, obj_file);
763,768d750
<
< LiveProcess *
< LiveProcessParams::create()
< {
< return LiveProcess::create(this);
< }