diff options
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/insts/microldstop.cc | 36 | ||||
-rw-r--r-- | src/arch/x86/process.cc | 7 |
2 files changed, 34 insertions, 9 deletions
diff --git a/src/arch/x86/insts/microldstop.cc b/src/arch/x86/insts/microldstop.cc index 9628256e4..9638a2ae3 100644 --- a/src/arch/x86/insts/microldstop.cc +++ b/src/arch/x86/insts/microldstop.cc @@ -64,16 +64,40 @@ namespace X86ISA const SymbolTable *symtab) const { std::stringstream response; + bool someAddr = false; printMnemonic(response, instMnem, mnemonic); - printDestReg(response, 0, dataSize); + if(flags[IsLoad]) + printDestReg(response, 0, dataSize); + else + printSrcReg(response, 2, dataSize); response << ", "; printSegment(response, segment); - ccprintf(response, ":[%d*", scale); - printSrcReg(response, 0, addressSize); - response << " + "; - printSrcReg(response, 1, addressSize); - ccprintf(response, " + %#x]", disp); + response << ":["; + if(scale != 0 && _srcRegIdx[0] != ZeroReg) + { + if(scale != 1) + ccprintf(response, "%d*", scale); + printSrcReg(response, 0, addressSize); + someAddr = true; + } + if(_srcRegIdx[1] != ZeroReg) + { + if(someAddr) + response << " + "; + printSrcReg(response, 1, addressSize); + someAddr = true; + } + if(disp != 0) + { + if(someAddr) + response << " + "; + ccprintf(response, "%#x", disp); + someAddr = true; + } + if(!someAddr) + response << "0"; + response << "]"; return response.str(); } } diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index 17904cb33..afe41cdeb 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -290,18 +290,19 @@ X86LiveProcess::argsInit(int intSize, int pageSize) //This is the name of the file which is present on the initial stack //It's purpose is to let the user space linker examine the original file. - int file_name_size = filename.size(); + int file_name_size = filename.size() + 1; string platform = "x86_64"; int aux_data_size = platform.size() + 1; int env_data_size = 0; for (int i = 0; i < envp.size(); ++i) { - env_data_size += envp[i].size(); + env_data_size += envp[i].size() + 1; } int arg_data_size = 0; for (int i = 0; i < argv.size(); ++i) { - arg_data_size += argv[i].size(); + warn("Argv[%d] size is %d\n", i, argv[i].size() + 1); + arg_data_size += argv[i].size() + 1; } //The auxiliary vector data needs to be padded so it's size is a multiple |